#include<bits/stdc++.h>
using namespace std;
unordered_map<string, int>m;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
string s;
cin >> n;
while(n--)
{
cin >> s;
++m[s];
}
if(m["1A"]>=1 && m["1B"]>=1 && m["1C"]>=1 && m["2A"]>=1 && m["2B"]>=1 && m["2C"]>=1 && m["3A"]>=1 && m["3B"]>=1 && m["3C"]>=1 && m["4A"]>=1 && m["4B"]>=1 && m["4C"]>=1 && m["5A"]>=2 && m["5B"]>=2 && m["5C"]>=2)
cout << "TAK";
else
cout << "NIE";
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 | #include<bits/stdc++.h> using namespace std; unordered_map<string, int>m; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; string s; cin >> n; while(n--) { cin >> s; ++m[s]; } if(m["1A"]>=1 && m["1B"]>=1 && m["1C"]>=1 && m["2A"]>=1 && m["2B"]>=1 && m["2C"]>=1 && m["3A"]>=1 && m["3B"]>=1 && m["3C"]>=1 && m["4A"]>=1 && m["4B"]>=1 && m["4C"]>=1 && m["5A"]>=2 && m["5B"]>=2 && m["5C"]>=2) cout << "TAK"; else cout << "NIE"; return 0; } |
English