#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int N;
cin >> N;
int current_place = 0;
string s;
int x;
for(int i = 0; i < N; i++){
cin >> s >> x;
if(current_place >= 20 || (current_place >= 10 && x >= 2) || s[0] == 'N') continue;
cout << i + 1 << ' ';
current_place++;
}
cout << endl;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <bits/stdc++.h> using namespace std; int main(){ cin.tie(NULL); ios_base::sync_with_stdio(false); int N; cin >> N; int current_place = 0; string s; int x; for(int i = 0; i < N; i++){ cin >> s >> x; if(current_place >= 20 || (current_place >= 10 && x >= 2) || s[0] == 'N') continue; cout << i + 1 << ' '; current_place++; } cout << endl; } |
English