#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "algo/debug.h"
#else
#define dbg(...)
#endif
using ll = long long;
int main(){
ios::sync_with_stdio(0);
cin.tie(nullptr);
int n; cin >> n;
vector<pair<int, int>> A;
for (int i = 0; i < n; i++) {
string s; cin >> s;
int t; cin >> t;
if (s != "NIE") A.emplace_back(i + 1, t);
}
for (int i = 0; i <= 9; i++) cout << A[i].first << " ";
int t = 0, i = 10;
while (t <= 9) {
if (A[i].second < 2) {
cout << A[i].first << " ";
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 | #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "algo/debug.h" #else #define dbg(...) #endif using ll = long long; int main(){ ios::sync_with_stdio(0); cin.tie(nullptr); int n; cin >> n; vector<pair<int, int>> A; for (int i = 0; i < n; i++) { string s; cin >> s; int t; cin >> t; if (s != "NIE") A.emplace_back(i + 1, t); } for (int i = 0; i <= 9; i++) cout << A[i].first << " "; int t = 0, i = 10; while (t <= 9) { if (A[i].second < 2) { cout << A[i].first << " "; t++; } i++; } return 0; } |
English