#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); vector<int> odp; int n,a; string chce; cin >> n; for (int x=1;x<=n;x++){ cin >> chce >> a; if (chce=="NIE")continue; if (odp.size()<10)odp.push_back(x); else{ if (odp.size()<20 && a<2)odp.push_back(x); } } for (int x:odp) cout << x << ' '; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <bits/stdc++.h> using namespace std; typedef long long int ll; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); vector<int> odp; int n,a; string chce; cin >> n; for (int x=1;x<=n;x++){ cin >> chce >> a; if (chce=="NIE")continue; if (odp.size()<10)odp.push_back(x); else{ if (odp.size()<20 && a<2)odp.push_back(x); } } for (int x:odp) cout << x << ' '; } |