/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int i,wzieci, a,n;
vector<int> uczestnicy;
string b;
cin>>n;
i=1;
while(true) {
cin>>b>>a;
if(b!="NIE"){
if(uczestnicy.size()<=10) {
uczestnicy.push_back(i);
}
else {
if(a<2){
uczestnicy.push_back(i);
}
}
}
if(uczestnicy.size()==20){
break;
}
i++;
}
for(i=0;i<uczestnicy.size();i++) {
cout<<uczestnicy[i]<<" ";
}
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | /****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int i,wzieci, a,n; vector<int> uczestnicy; string b; cin>>n; i=1; while(true) { cin>>b>>a; if(b!="NIE"){ if(uczestnicy.size()<=10) { uczestnicy.push_back(i); } else { if(a<2){ uczestnicy.push_back(i); } } } if(uczestnicy.size()==20){ break; } i++; } for(i=0;i<uczestnicy.size();i++) { cout<<uczestnicy[i]<<" "; } return 0; } |
English