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
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;

int main(void){
    int n, k, l;
    char s[4];
    
    vector<int> list;
    scanf("%d", &n);
    l = 0;
    for(int i = 0; i<n; i++){
        scanf("%s %d", s, &k);
        if(s[0]=='N') continue;
        if(l < 10){
            list.push_back(i+1);
            l++;
        }
        else if(k < 2){
            list.push_back(i+1);
            l++;
        }
        if(l == 20) break;
    }

    for(int i = 0; i < 20; i++){
        printf("%d ", list[i]);
    }
    printf("\n");

    return 0;
}