#include <bits/stdc++.h> #define ll long long using namespace std; int n; static vector<string> zadania= { "1A","1B","1C", "2A","2B","2C", "3A","3B","3C", "4A","4B","4C", "5A","5B","5C" }; int main(){ scanf("%d" , &n); vector<int> check(15, 0); string tmp; for(int i = 0; i< n; i++){ cin >>tmp; for(int j = 0; j <15;j++){ if(tmp == zadania[j]){ check[j] += 1; } } } for(int i = 0; i<15;i++){ if(i<12){ if(check[i]<1){ printf("NIE"); return 0; } } else{ if(check[i]<2){ printf("NIE"); return 0; } } } printf("TAK"); }
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 36 37 38 39 40 41 42 43 44 45 46 47 48 | #include <bits/stdc++.h> #define ll long long using namespace std; int n; static vector<string> zadania= { "1A","1B","1C", "2A","2B","2C", "3A","3B","3C", "4A","4B","4C", "5A","5B","5C" }; int main(){ scanf("%d" , &n); vector<int> check(15, 0); string tmp; for(int i = 0; i< n; i++){ cin >>tmp; for(int j = 0; j <15;j++){ if(tmp == zadania[j]){ check[j] += 1; } } } for(int i = 0; i<15;i++){ if(i<12){ if(check[i]<1){ printf("NIE"); return 0; } } else{ if(check[i]<2){ printf("NIE"); return 0; } } } printf("TAK"); } |