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
#include <bits/stdc++.h>
using namespace std;

int main(){
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);

    int n;
    cin >> n;
    int licz = 0;
    string odp = "";
    string czy_chce; int ile_finalow;
    for (int i = 0;i < n;i++){
        cin >> czy_chce >> ile_finalow;
        if (czy_chce == "NIE"){
            continue;
        }
        if (licz < 10){
            odp += to_string(i+1) + " ";
            licz ++;
        }
        else if (ile_finalow < 2){
            odp += to_string(i+1) + " ";
            licz ++;
        }
        if (licz == 20){
            cout << odp << '\n';
            return 0;
        }
    } 
return 0;
}