#include<bits/stdc++.h>
using namespace std;
int n;
string s;
set<string> secik;
int pa, pb, pc;
int main(){
std::ios_base::sync_with_stdio(0);
cin.tie();
cout.tie();
cin >> n;
for(int i=0; i<n; i++){
cin >> s;
if(s=="5A")pa++;
if(s=="5B")pb++;
if(s=="5C")pc++;
secik.insert(s);
}
if(secik.size()==15 && pa>1 && pb>1 && pc>1)
cout << "TAK";
else
cout << "NIE";
}
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 | #include<bits/stdc++.h> using namespace std; int n; string s; set<string> secik; int pa, pb, pc; int main(){ std::ios_base::sync_with_stdio(0); cin.tie(); cout.tie(); cin >> n; for(int i=0; i<n; i++){ cin >> s; if(s=="5A")pa++; if(s=="5B")pb++; if(s=="5C")pc++; secik.insert(s); } if(secik.size()==15 && pa>1 && pb>1 && pc>1) cout << "TAK"; else cout << "NIE"; } |
English