#include <bits/stdc++.h>
using namespace std;
#define st first
#define nd second
int n;
int t[10004];
int id[10004];
vector<int> res;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
int ctr = 1;
for (int i = 1 ; i <= n ; i++, ctr++) {
string a;
id[i] = ctr;
cin >> a >> t[i];
if(a == "NIE") {
i--; n--;
}
}
for (int i = 1 ; i <= 10 ; i++) {
res.push_back(id[i]);
}
ctr = 0;
for (int i = 11 ; ctr < 10; i++) {
if(t[i] < 2) {
res.push_back(id[i]);
ctr++;
}
}
for (int i = 0 ; i < 20 ; i++) {
cout << res[i] << " ";
}
}
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 | #include <bits/stdc++.h> using namespace std; #define st first #define nd second int n; int t[10004]; int id[10004]; vector<int> res; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n; int ctr = 1; for (int i = 1 ; i <= n ; i++, ctr++) { string a; id[i] = ctr; cin >> a >> t[i]; if(a == "NIE") { i--; n--; } } for (int i = 1 ; i <= 10 ; i++) { res.push_back(id[i]); } ctr = 0; for (int i = 11 ; ctr < 10; i++) { if(t[i] < 2) { res.push_back(id[i]); ctr++; } } for (int i = 0 ; i < 20 ; i++) { cout << res[i] << " "; } } |
English