#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
vector<string> pattern{"1A", "1B", "1C", "2A", "2B", "2C", "3A", "3B", "3C", "4A", "4B", "4C", "5A", "5A", "5B", "5B", "5C", "5C"};
int n;
cin>>n;
vector<string> tab;
for(int i=0; i<n; i++){
string temp;
cin>>temp;
tab.push_back(temp);
}
sort(tab.begin(), tab.end());
int j=0;
for(auto a : tab){
if(pattern[j]==a){
j++;
}
if(j>=18){
cout<<"TAK";
return 0;
}
}
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 25 26 27 28 29 30 | #include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ vector<string> pattern{"1A", "1B", "1C", "2A", "2B", "2C", "3A", "3B", "3C", "4A", "4B", "4C", "5A", "5A", "5B", "5B", "5C", "5C"}; int n; cin>>n; vector<string> tab; for(int i=0; i<n; i++){ string temp; cin>>temp; tab.push_back(temp); } sort(tab.begin(), tab.end()); int j=0; for(auto a : tab){ if(pattern[j]==a){ j++; } if(j>=18){ cout<<"TAK"; return 0; } } cout<<"NIE"; return 0; } |
English