#include<bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
string chce; int starts;
vector<pair<int,int> > ziomy;
for(int i = 0; i < n; i++){
cin >> chce>> starts;
if(chce == "TAK"){
ziomy.push_back({i+1, starts});
}
}
int wsk = 0, zebrani = 0;
for(int i = 0; i < 10; i++)
cout << ziomy[i].first << " ";
wsk = 10;
while(zebrani < 10){
if(ziomy[wsk].second< 2){
cout << ziomy[wsk].first << " ";
zebrani++;
}
wsk++;
}
}
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 | #include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; string chce; int starts; vector<pair<int,int> > ziomy; for(int i = 0; i < n; i++){ cin >> chce>> starts; if(chce == "TAK"){ ziomy.push_back({i+1, starts}); } } int wsk = 0, zebrani = 0; for(int i = 0; i < 10; i++) cout << ziomy[i].first << " "; wsk = 10; while(zebrani < 10){ if(ziomy[wsk].second< 2){ cout << ziomy[wsk].first << " "; zebrani++; } wsk++; } } |
English