#include <iostream> int main() { std::ios_base::sync_with_stdio(0); int n; std::cin >> n; int k = 0; int i=0; while (n--) { ++i; std::string y; int x; std::cin >> y >> x; if (y == "NIE") continue; if (k < 20 && (k < 10 || x < 2)) { ++k; std::cout << i << " "; } } 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 | #include <iostream> int main() { std::ios_base::sync_with_stdio(0); int n; std::cin >> n; int k = 0; int i=0; while (n--) { ++i; std::string y; int x; std::cin >> y >> x; if (y == "NIE") continue; if (k < 20 && (k < 10 || x < 2)) { ++k; std::cout << i << " "; } } return 0; } |