#include<bits/stdc++.h>
using namespace std;
int l[20];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int n, ans=0;
cin >> n;
while(n--) {
string x;
cin >> x;
int p=(x[0]-'0')+5*(x[1]-'A');
if(!l[p]) ++ans;
++l[p];
}
if(ans==15 && l[5]>=2 && l[10]>=2 && l[15]>=2) cout << "TAK"; else cout << "NIE";
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include<bits/stdc++.h> using namespace std; int l[20]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, ans=0; cin >> n; while(n--) { string x; cin >> x; int p=(x[0]-'0')+5*(x[1]-'A'); if(!l[p]) ++ans; ++l[p]; } if(ans==15 && l[5]>=2 && l[10]>=2 && l[15]>=2) cout << "TAK"; else cout << "NIE"; } |
English