#include <bits/stdc++.h> #define nl '\n' using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int n; cin>>n; vector<int> ucz; int zakw = 0; for(int i=0; i<n; i++){ string s; int k; cin>>s>>k; if(s == "NIE") continue; if(zakw < 10 || k < 2){ ucz.push_back(i+1); zakw++; } if(zakw >= 20) break; } for(auto i: ucz){ cout<<i<<' '; } cout<<nl; return 0; }
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 | #include <bits/stdc++.h> #define nl '\n' using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int n; cin>>n; vector<int> ucz; int zakw = 0; for(int i=0; i<n; i++){ string s; int k; cin>>s>>k; if(s == "NIE") continue; if(zakw < 10 || k < 2){ ucz.push_back(i+1); zakw++; } if(zakw >= 20) break; } for(auto i: ucz){ cout<<i<<' '; } cout<<nl; return 0; } |