#include <iostream>
#include <string>
using namespace std;
const int SUPERSLOTS = 10;
const int NEWBIESLOTS = 10;
const int MAX_SLOTS = SUPERSLOTS + NEWBIESLOTS;
const int NEWBIE_LIMIT = 1;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, used_slots = 0;
cin >> n;
for (int i = 1; used_slots < MAX_SLOTS; i++) {
string s;
int prev_starts;
cin >> s >> prev_starts;
if (s == "NIE")
continue;
if (used_slots < SUPERSLOTS || prev_starts <= NEWBIE_LIMIT) {
cout << i << " ";
used_slots++;
}
}
cout << endl;
}
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 | #include <iostream> #include <string> using namespace std; const int SUPERSLOTS = 10; const int NEWBIESLOTS = 10; const int MAX_SLOTS = SUPERSLOTS + NEWBIESLOTS; const int NEWBIE_LIMIT = 1; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, used_slots = 0; cin >> n; for (int i = 1; used_slots < MAX_SLOTS; i++) { string s; int prev_starts; cin >> s >> prev_starts; if (s == "NIE") continue; if (used_slots < SUPERSLOTS || prev_starts <= NEWBIE_LIMIT) { cout << i << " "; used_slots++; } } cout << endl; } |
English