#include <iostream>
#include <set>
using namespace std;
long long b, licz10, n, x;
string a;
long long t[204];
int main()
{
cin.tie(0);
std::ios_base::sync_with_stdio(0);
cout.tie(0);
cin >> n;
for (long long i = 1; i <= n; ++i)
{
cin >> a >> b;
if (licz10 < 10 && a == "TAK")
{
x++;
licz10++;
t[x] = i;
continue;
}
else if (a == "TAK" && licz10 < 20 && licz10 >= 10 && b < 2)
{
x++;
licz10++;
t[x] = i;
}
if (licz10 == 20) break;
}
for (long long i = 1; i <= 20; ++i)
{
cout << t[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 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #include <iostream> #include <set> using namespace std; long long b, licz10, n, x; string a; long long t[204]; int main() { cin.tie(0); std::ios_base::sync_with_stdio(0); cout.tie(0); cin >> n; for (long long i = 1; i <= n; ++i) { cin >> a >> b; if (licz10 < 10 && a == "TAK") { x++; licz10++; t[x] = i; continue; } else if (a == "TAK" && licz10 < 20 && licz10 >= 10 && b < 2) { x++; licz10++; t[x] = i; } if (licz10 == 20) break; } for (long long i = 1; i <= 20; ++i) { cout << t[i] << " "; } return 0; } |
English