#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double db;
typedef pair<int,int> pii;
int main(){
int n,res=0;
cin >> n;
for(int i=1; i<=n; ++i){
string s;
int cnt;
cin >> s >> cnt;
if(res<10){
if(s == "TAK"){
cout << i << " ";
++res;
}
}else if(res < 20 && s == "TAK" && cnt < 2){
cout << i << " ";
++res;
}
}
}
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 | #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double db; typedef pair<int,int> pii; int main(){ int n,res=0; cin >> n; for(int i=1; i<=n; ++i){ string s; int cnt; cin >> s >> cnt; if(res<10){ if(s == "TAK"){ cout << i << " "; ++res; } }else if(res < 20 && s == "TAK" && cnt < 2){ cout << i << " "; ++res; } } } |
English