#include<bits/stdc++.h> using namespace std; #ifdef DEBUG auto&operator <<(auto& o, pair<auto, auto> p) {return o<<"{"<<p.first<<", "<<p.second<<"}";} auto operator <<(auto& o, auto x)->decltype(x.end(), o) {o<<"{"; for(auto v : x) o<<v<<", "; return o<<"}";} #define debug(X...) cerr<<"["#X"]: ", [](auto...$) {((cerr<<$<<"; "),...)<<endl;}(X) #else #define debug(...){} #endif #define int long long const int INF = 1e18+7; #define mp(x, y) make_pair(x, y) #define fi first #define se second #define eb emplace_back int32_t main() { cin.tie(0)->sync_with_stdio(0); int n; cin>>n; vector<int> res; for(int i=1;i<=n;i++) { string s; cin>>s; int x; cin>>x; if(s == "NIE") continue; if(x < 2 && res.size() < 20) res.eb(i); if(x >= 2 && res.size() < 10) res.eb(i); } for(auto v : res) cout<<v<<" "; }
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; #ifdef DEBUG auto&operator <<(auto& o, pair<auto, auto> p) {return o<<"{"<<p.first<<", "<<p.second<<"}";} auto operator <<(auto& o, auto x)->decltype(x.end(), o) {o<<"{"; for(auto v : x) o<<v<<", "; return o<<"}";} #define debug(X...) cerr<<"["#X"]: ", [](auto...$) {((cerr<<$<<"; "),...)<<endl;}(X) #else #define debug(...){} #endif #define int long long const int INF = 1e18+7; #define mp(x, y) make_pair(x, y) #define fi first #define se second #define eb emplace_back int32_t main() { cin.tie(0)->sync_with_stdio(0); int n; cin>>n; vector<int> res; for(int i=1;i<=n;i++) { string s; cin>>s; int x; cin>>x; if(s == "NIE") continue; if(x < 2 && res.size() < 20) res.eb(i); if(x >= 2 && res.size() < 10) res.eb(i); } for(auto v : res) cout<<v<<" "; } |