// https://sio2.mimuw.edu.pl/c/pa-2025-1/p/fin/
#include <bits/stdc++.h>
#define st first
#define nd second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rep(i, a) for (int i = 0; i < int(a); i++)
#define rep1(i, a) for (int i = 1; i <= int(a); i++)
#define los(a, b) (rng() % (int)(b - a + 1) + (int)(a))
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
const int MAXN = 1;
int main() {
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
vector<int> res;
rep1(i, n) {
string s;
int x;
cin >> s >> x;
if ((res.size() < 10 && s == "TAK") ||
(res.size() < 20 && s == "TAK" && x < 2))
res.pb(i);
}
for (auto i : res)
cout << i << ' ';
cout << '\n';
}
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 | // https://sio2.mimuw.edu.pl/c/pa-2025-1/p/fin/ #include <bits/stdc++.h> #define st first #define nd second #define pb push_back #define all(x) x.begin(), x.end() #define rep(i, a) for (int i = 0; i < int(a); i++) #define rep1(i, a) for (int i = 1; i <= int(a); i++) #define los(a, b) (rng() % (int)(b - a + 1) + (int)(a)) using namespace std; typedef long long ll; typedef pair<int, int> pi; const int MAXN = 1; int main() { cin.tie(0)->sync_with_stdio(0); int n; cin >> n; vector<int> res; rep1(i, n) { string s; int x; cin >> s >> x; if ((res.size() < 10 && s == "TAK") || (res.size() < 20 && s == "TAK" && x < 2)) res.pb(i); } for (auto i : res) cout << i << ' '; cout << '\n'; } |
English