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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <bits/stdc++.h>

typedef bool bool_t;
typedef char char_t;
typedef long long int_t;
typedef std::string str_t;
typedef std::vector<bool_t> vecbool_t;
typedef std::vector<int_t> vecint_t;

int_t n;
vecbool_t s;
vecint_t x;

void s1();

int32_t main()
{
    std::ios_base::sync_with_stdio(0);
    std::cin.tie(0);

    std::cin >> n;

    s.resize(n);
    x.resize(n);
    for(int_t i = 0; i < n; i++)
    {
        str_t s_str;
        std::cin >> s_str;

        if(s_str == "TAK")
            s[i] = true;

        std::cin >> x[i];
    }

    s1();

    return 0;
}

void s1()
{
    int_t j = 0;
    vecint_t list(20);

    for(int_t i = 0; i < n; i++)
    {
        if(j == 20)
            break;

        if(!s[i])
            continue;

        if(j < 10 || x[i] < 2)
            list[j++] = i + 1;
    }

    for(int_t i = 0; i < 20; i++)
        std::cout << list[i] << ' ';
    std::cout << '\n';
}