#include <bits/stdc++.h> using namespace std; queue<int> kto; queue<int> inni; int main() { int t, ile = 0, o = 1; cin>>t; while(t--){ string a; int b; cin>>a>>b; if(a != "NIE"){ if(ile < 10){ ile++; kto.push(o); }else{ if(b < 2){ ile++; kto.push(o); } } } if(ile == 20){ break; } o++; } while(!kto.empty()){ cout<<kto.front()<<" "; kto.pop(); } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #include <bits/stdc++.h> using namespace std; queue<int> kto; queue<int> inni; int main() { int t, ile = 0, o = 1; cin>>t; while(t--){ string a; int b; cin>>a>>b; if(a != "NIE"){ if(ile < 10){ ile++; kto.push(o); }else{ if(b < 2){ ile++; kto.push(o); } } } if(ile == 20){ break; } o++; } while(!kto.empty()){ cout<<kto.front()<<" "; kto.pop(); } } |