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 <cstdio>
#include <vector>
#include <utility>

using namespace std;

int main() { 
    int n;
    scanf("%d", &n);
    int taken = 0;
    for (int i = 1; i <= n; i++) {
        char s[10];
        int c;
        scanf("%s%d", s, &c);
       
        if (s[0] == 'N' || taken == 20) {
            continue;
        }

        if (taken < 10 || c < 2) {
            printf("%d ", i);
            taken++;
        }
    }
    printf("\n");
}


// g++ -std=c++17 -Wall -Wextra -Wshadow C.cpp -o C