#include <bits/stdc++.h>
using namespace std;
int n, x;
string s;
int main(){
cin>>n;
int true_fin = 10;
int cheat_fin = 10;
// cout<<endl;
for(int i = 0; i < n; i++){
cin>>s>>x;
if(s == "TAK"){
if(true_fin > 0){
true_fin--;
cout<<i+1<<" ";
continue;
}
if(cheat_fin > 0 && x < 2){
cheat_fin--;
cout<<i+1<<" ";
continue;
}
}
}
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 | #include <bits/stdc++.h> using namespace std; int n, x; string s; int main(){ cin>>n; int true_fin = 10; int cheat_fin = 10; // cout<<endl; for(int i = 0; i < n; i++){ cin>>s>>x; if(s == "TAK"){ if(true_fin > 0){ true_fin--; cout<<i+1<<" "; continue; } if(cheat_fin > 0 && x < 2){ cheat_fin--; cout<<i+1<<" "; continue; } } } return 0; } |
English