#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
int n, ile, ile1;
string czy;
pair<int, int> t[10000];
int main()
{
ios_base::sync_with_stdio(false);
cout.tie(nullptr);
cin.tie(nullptr);
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> czy >> t[ile].first;
t[ile].second = i+1;
if (czy[0] == 'T') ile++;
}
for (int i = 0; i < 10; i++)
cout << t[i].second << ' ';
for (int i = 10; i < ile; i++)
{
if (t[i].first < 2)
{
cout << t[i].second << ' ';
if (++ile1 == 10) return 0;
}
}
}
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 | #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned int uint; int n, ile, ile1; string czy; pair<int, int> t[10000]; int main() { ios_base::sync_with_stdio(false); cout.tie(nullptr); cin.tie(nullptr); cin >> n; for (int i = 0; i < n; i++) { cin >> czy >> t[ile].first; t[ile].second = i+1; if (czy[0] == 'T') ile++; } for (int i = 0; i < 10; i++) cout << t[i].second << ' '; for (int i = 10; i < ile; i++) { if (t[i].first < 2) { cout << t[i].second << ' '; if (++ile1 == 10) return 0; } } } |
English