#include <iostream>
#include <string>
int main()
{
int n = 0;
std::cin >> n;
int pos_rank = 0;
for (int i = 0; i < n && pos_rank < 20; i++) {
int x = 0;
std::string a;
std::cin >> a;
std::cin >> x;
if (a == "TAK") {
if (pos_rank < 10) {
std::cout << (i + 1) << " ";
pos_rank++;
}
else if (x < 2) {
std::cout << (i + 1) << " ";
pos_rank++;
}
}
}
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include <iostream> #include <string> int main() { int n = 0; std::cin >> n; int pos_rank = 0; for (int i = 0; i < n && pos_rank < 20; i++) { int x = 0; std::string a; std::cin >> a; std::cin >> x; if (a == "TAK") { if (pos_rank < 10) { std::cout << (i + 1) << " "; pos_rank++; } else if (x < 2) { std::cout << (i + 1) << " "; pos_rank++; } } } } |
English