#include <bits/stdc++.h>
using namespace std;
int main() {
string buf="";
bool willing=false; int tries=0;
//
uint64_t y=0,x=0;
cin >> y;
for (int i=0; i<y && x<20; i++) {
cin >> buf;
if (buf == "TAK") willing = true;
else willing = false;
cin >> tries;
if (willing == true) {
if (x < 10) {
cout << i+1 << ' ';
x++;
}
else if (tries < 2) {
cout << i+1 << ' ';
x++;
}
}
}
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 | #include <bits/stdc++.h> using namespace std; int main() { string buf=""; bool willing=false; int tries=0; // uint64_t y=0,x=0; cin >> y; for (int i=0; i<y && x<20; i++) { cin >> buf; if (buf == "TAK") willing = true; else willing = false; cin >> tries; if (willing == true) { if (x < 10) { cout << i+1 << ' '; x++; } else if (tries < 2) { cout << i+1 << ' '; x++; } } } return 0; } |
English