#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
//istringstream input("35 \n NIE 0 \n NIE 0 \n TAK 3 \n TAK 0 \n TAK 7 \n TAK 5 \n NIE 0 \n NIE 0 \n TAK 7 \n TAK 1 \n NIE 0 \n TAK 8 \n TAK 1 \n TAK 3 \n NIE 0 \n TAK 2 \n NIE 0 \n TAK 1 \n NIE 4 \n TAK 2 \n TAK 2 \n TAK 1 \n TAK 1 \n TAK 0 \n TAK 0 \n TAK 0 \n TAK 0 \n TAK 0 \n NIE 0 \n TAK 1 \n TAK 2 \n TAK 0 \n TAK 0 \n TAK 0 \n TAK 0");
//cin.rdbuf(input.rdbuf());
int l_zawodnikow;
cin >> l_zawodnikow;
int n = 0;
for (int i = 1; i <= l_zawodnikow; i++) {
string czy;
int l_podejsc;
cin >> czy >> l_podejsc;
if (n >= 20) {continue;}
if (czy == "TAK") {
if (n < 10 || l_podejsc < 2) {
cout << i << " ";
n++;
}
}
}
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 | #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); //istringstream input("35 \n NIE 0 \n NIE 0 \n TAK 3 \n TAK 0 \n TAK 7 \n TAK 5 \n NIE 0 \n NIE 0 \n TAK 7 \n TAK 1 \n NIE 0 \n TAK 8 \n TAK 1 \n TAK 3 \n NIE 0 \n TAK 2 \n NIE 0 \n TAK 1 \n NIE 4 \n TAK 2 \n TAK 2 \n TAK 1 \n TAK 1 \n TAK 0 \n TAK 0 \n TAK 0 \n TAK 0 \n TAK 0 \n NIE 0 \n TAK 1 \n TAK 2 \n TAK 0 \n TAK 0 \n TAK 0 \n TAK 0"); //cin.rdbuf(input.rdbuf()); int l_zawodnikow; cin >> l_zawodnikow; int n = 0; for (int i = 1; i <= l_zawodnikow; i++) { string czy; int l_podejsc; cin >> czy >> l_podejsc; if (n >= 20) {continue;} if (czy == "TAK") { if (n < 10 || l_podejsc < 2) { cout << i << " "; n++; } } } return 0; } |
English