#include<bits/stdc++.h> using namespace std; using ll=long long; using pi=pair<int,int>; using vi=vector<int>; using vl=vector<ll>; using vpi=vector<pi>; #define mp make_pair #define eb emplace_back #define x first #define y second #define sz(x)int((x).size()) #define all(x)(x).begin(),(x).end() #define rep(i,a,b)for(int i=(a);i<(b);i++) #define per(i,a,b)for(int i=(b)-1;i>=(a);i--) bool ckmin(auto&a,auto b){return b<a?a=b,1:0;} bool ckmax(auto&a,auto b){return b>a?a=b,1:0;} #ifdef LOCAL auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.x<<", "<<p.y<<")";} auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto&e:x)o<<","+!i++<<e;return o<<"}";} #define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X); #else #define debug(...){} #endif signed main() { cin.tie(0)->sync_with_stdio(0); int n; cin >> n; vpi a; rep(i, 0, n) { string type; int x; cin >> type >> x; if (type == "TAK") a.eb(x, i); } vi b; rep(i, 0, sz(a)) { if (i < 10 || a[i].x < 2) b.eb(a[i].y); } assert(sz(b) >= 20); rep(i, 0, 20) { cout << b[i] + 1 << (i < 19 ? " " : "\n"); } 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #include<bits/stdc++.h> using namespace std; using ll=long long; using pi=pair<int,int>; using vi=vector<int>; using vl=vector<ll>; using vpi=vector<pi>; #define mp make_pair #define eb emplace_back #define x first #define y second #define sz(x)int((x).size()) #define all(x)(x).begin(),(x).end() #define rep(i,a,b)for(int i=(a);i<(b);i++) #define per(i,a,b)for(int i=(b)-1;i>=(a);i--) bool ckmin(auto&a,auto b){return b<a?a=b,1:0;} bool ckmax(auto&a,auto b){return b>a?a=b,1:0;} #ifdef LOCAL auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.x<<", "<<p.y<<")";} auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto&e:x)o<<","+!i++<<e;return o<<"}";} #define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X); #else #define debug(...){} #endif signed main() { cin.tie(0)->sync_with_stdio(0); int n; cin >> n; vpi a; rep(i, 0, n) { string type; int x; cin >> type >> x; if (type == "TAK") a.eb(x, i); } vi b; rep(i, 0, sz(a)) { if (i < 10 || a[i].x < 2) b.eb(a[i].y); } assert(sz(b) >= 20); rep(i, 0, 20) { cout << b[i] + 1 << (i < 19 ? " " : "\n"); } return 0; } |