#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int x;
int main(){
cin>>n;
int l1 = 0;
int l2 = 0;
for(int i=0;i<n;i++){
cin>>s>>x;
if(s == "TAK" && l1 < 10){
cout<<i+1<<" ";
l1++;
} else if (s == "TAK" && x < 2 && l2 < 10){
cout<<i+1<<" ";
l2++;
}
if(l2 == 10) break;
}
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <bits/stdc++.h> using namespace std; int n; string s; int x; int main(){ cin>>n; int l1 = 0; int l2 = 0; for(int i=0;i<n;i++){ cin>>s>>x; if(s == "TAK" && l1 < 10){ cout<<i+1<<" "; l1++; } else if (s == "TAK" && x < 2 && l2 < 10){ cout<<i+1<<" "; l2++; } if(l2 == 10) break; } } |
English