#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.hpp"
#else
#define debug(...) 13.09
#endif
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
#define sz(x) (static_cast<int>((x).size()))
using vi = vector<int>;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n; cin >> n;
int cnt = 0;
for (int i = 1; i <= n; i++) {
string s; int x;
cin >> s >> x;
if (s == "TAK" && (cnt < 10 || (cnt < 20 && x < 2))) {
cout << i << ' ';
cnt++;
}
}
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 31 32 33 34 35 | #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.hpp" #else #define debug(...) 13.09 #endif using i32 = int; using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; #define sz(x) (static_cast<int>((x).size())) using vi = vector<int>; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; int cnt = 0; for (int i = 1; i <= n; i++) { string s; int x; cin >> s >> x; if (s == "TAK" && (cnt < 10 || (cnt < 20 && x < 2))) { cout << i << ' '; cnt++; } } cout << '\n'; } |
English