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
#include <vector>
#include <cstdio>
using namespace std;

int main()
{
    int N;
    vector<int> result;
    scanf("%d", &N);
    for (int i = 1; i <= N; ++i)
    {
        char yesno[8];
        int timez;
        scanf("%s%d", yesno, &timez);
        if (yesno[0] == 'N')
            continue;
        if (result.size() >= 10 && timez >= 2)
            continue;
        result.push_back(i);
        if (result.size() == 20)
            break;
    }
    for (int a : result)
        printf("%d ", a);
}