#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include "lib/debug.h"
#else
#define debug(...) 228
#endif
#define pb push_back
typedef long long ll;
typedef long double ld;
int n;
const int maxN = 1e5 + 10;
string s[maxN];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
#ifdef DEBUG
freopen("input.txt", "r", stdin);
#endif
cin >> n;
vector<int> ans;
for (int i = 1; i <= n; i++) {
cin >> s[i];
int x;
cin >> x;
if (s[i] == "TAK") {
if ((int)ans.size() < 20 && ((int)ans.size() < 10 || (x < 2))) {
ans.emplace_back(i);
}
}
}
for (int v : ans) cout << v << " ";
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 | #ifdef DEBUG #define _GLIBCXX_DEBUG #endif //#pragma GCC optimize("O3") #include<bits/stdc++.h> using namespace std; #ifdef DEBUG #include "lib/debug.h" #else #define debug(...) 228 #endif #define pb push_back typedef long long ll; typedef long double ld; int n; const int maxN = 1e5 + 10; string s[maxN]; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); #ifdef DEBUG freopen("input.txt", "r", stdin); #endif cin >> n; vector<int> ans; for (int i = 1; i <= n; i++) { cin >> s[i]; int x; cin >> x; if (s[i] == "TAK") { if ((int)ans.size() < 20 && ((int)ans.size() < 10 || (x < 2))) { ans.emplace_back(i); } } } for (int v : ans) cout << v << " "; return 0; } |
English