//Jakub Leszczynski 2D
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, j = 0, a = 1 ;
cin>> n;
int * tab = new int [n];
string s;
for(int i = 1; i <= n; i++){
j++;
cin >> s;
cin>> x;
if(s == "TAK" && a <= 10){
cout<<i<<" ";
a++;
}else{
if(s == "TAK" && x < 2 && a <= 20){
cout<<i<<" ";
a++;
}
}
}
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 31 32 | //Jakub Leszczynski 2D #include <bits/stdc++.h> using namespace std; int main() { int n, x, j = 0, a = 1 ; cin>> n; int * tab = new int [n]; string s; for(int i = 1; i <= n; i++){ j++; cin >> s; cin>> x; if(s == "TAK" && a <= 10){ cout<<i<<" "; a++; }else{ if(s == "TAK" && x < 2 && a <= 20){ cout<<i<<" "; a++; } } } return 0; } |
English