#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
int n,k,licz=0;
cin >> n;
for(int i = 0; i<n; i++)
{
cin >> s >> k;
if(s[0] == 'T')
{
if(licz < 10)
{
cout << i+1 << " ";
licz++;
}
else if(licz < 20 && k < 2)
{
cout << i+1 << " ";
licz++;
}
}
}
}
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 | #include <bits/stdc++.h> using namespace std; int main() { string s; int n,k,licz=0; cin >> n; for(int i = 0; i<n; i++) { cin >> s >> k; if(s[0] == 'T') { if(licz < 10) { cout << i+1 << " "; licz++; } else if(licz < 20 && k < 2) { cout << i+1 << " "; licz++; } } } } |
English