#include <cstdio>
#include <cstdint>
#include <vector>
#include <bitset>
using namespace std;
int n;
int main ()
{
scanf("%d", &n);
int found = 0;
bool addSpace = false;
for(int i = 1; i <= n && found < 20; ++i)
{
char yesOrNo[5];
int starts;
scanf("%s", yesOrNo);
scanf("%d", &starts);
if(yesOrNo[0] == 'T' && (found < 10 || starts < 2))
{
if(addSpace)
{
printf(" ");
}
printf("%d", i);
++found;
addSpace = true;
}
}
printf("\n");
}
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 | #include <cstdio> #include <cstdint> #include <vector> #include <bitset> using namespace std; int n; int main () { scanf("%d", &n); int found = 0; bool addSpace = false; for(int i = 1; i <= n && found < 20; ++i) { char yesOrNo[5]; int starts; scanf("%s", yesOrNo); scanf("%d", &starts); if(yesOrNo[0] == 'T' && (found < 10 || starts < 2)) { if(addSpace) { printf(" "); } printf("%d", i); ++found; addSpace = true; } } printf("\n"); } |
English