#include <iostream>
#include <vector>
using namespace std;
int main(){
cin.tie(0);cout.tie(0);
ios_base::sync_with_stdio(false);
int n; cin >> n;
int A[15] = {0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1};
int x = 0;
for(int i=0;i<n;i++){
string a; cin >> a;
int temp = (a[0]-'1')*3 + a[1] - 'A';
// cout << a << ' ' << temp << '\n';
if(A[temp] < 1)x++;
A[temp]++;
}
if(x==18)cout << "TAK" << '\n';
else cout << "NIE" << '\n';
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <iostream> #include <vector> using namespace std; int main(){ cin.tie(0);cout.tie(0); ios_base::sync_with_stdio(false); int n; cin >> n; int A[15] = {0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1}; int x = 0; for(int i=0;i<n;i++){ string a; cin >> a; int temp = (a[0]-'1')*3 + a[1] - 'A'; // cout << a << ' ' << temp << '\n'; if(A[temp] < 1)x++; A[temp]++; } if(x==18)cout << "TAK" << '\n'; else cout << "NIE" << '\n'; } |
English