#include "bits/stdc++.h"
using namespace std;
#define int long long
const int N = 2e5+1;
const int mod = 1e9+7;
int n, k;
signed main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int _;_ = 1;//cin >> _;
while (_--) {
int n;
cin >> n;
vector<int> ans;
for(int i = 1; i <= n; i++)
{
string s; int x;cin >> s>> x;
if(ans.size() == 20) continue;
if(s == "TAK" && ans.size() < 10) ans.push_back(i);
else if(s == "TAK" && x < 2) ans.push_back(i);
}
for(auto it : ans) cout << it << ' ';
}
}
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 | #include "bits/stdc++.h" using namespace std; #define int long long const int N = 2e5+1; const int mod = 1e9+7; int n, k; signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int _;_ = 1;//cin >> _; while (_--) { int n; cin >> n; vector<int> ans; for(int i = 1; i <= n; i++) { string s; int x;cin >> s>> x; if(ans.size() == 20) continue; if(s == "TAK" && ans.size() < 10) ans.push_back(i); else if(s == "TAK" && x < 2) ans.push_back(i); } for(auto it : ans) cout << it << ' '; } } |
English