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
#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n,curr;
    string a;
    vector<pair<int,int>> v;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a>>curr;
        if(a=="TAK") v.push_back({curr,i});
    }
    int counter=0;
    for(int i=0;i<v.size();i++)
    {
        if(counter==20)
        {
            break;
        }
        else if(counter>=10)
        {
            if(v[i].first>=2) continue;
        }
        cout<<v[i].second+1<<" ";
        counter++;
    }
}