#include "bits/stdc++.h"
#define meow main
#define pi pair<int, int>
using namespace std;
signed meow() {
cin.tie((ostream *)!ios::sync_with_stdio(false));
int n;
cin >> n;
vector<pi> input(n);
for (auto &[a, b] : input) {
string s;
cin >> s;
a = (s == "TAK");
cin >> b;
}
int num = 0;
for (int i = 0; i < n; i++) {
if (num < 10 && input[i].first) {
cout << i + 1 << ' ';
num++;
continue;
}
if (num >= 10 && num < 20) {
if (input[i].second < 2 && input[i].first) {
cout << i + 1 << ' ';
num++;
}
}
}
}
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 | #include "bits/stdc++.h" #define meow main #define pi pair<int, int> using namespace std; signed meow() { cin.tie((ostream *)!ios::sync_with_stdio(false)); int n; cin >> n; vector<pi> input(n); for (auto &[a, b] : input) { string s; cin >> s; a = (s == "TAK"); cin >> b; } int num = 0; for (int i = 0; i < n; i++) { if (num < 10 && input[i].first) { cout << i + 1 << ' '; num++; continue; } if (num >= 10 && num < 20) { if (input[i].second < 2 && input[i].first) { cout << i + 1 << ' '; num++; } } } } |
English