#include <bits/stdc++.h>
using namespace std;
int tab[20];
int main() {
int n;
string zad;
cin>>n;
for(int i=0; i<n;i++ )
{
cin>>zad;
if(zad == "1A") tab[1]=1;
if(zad == "1B") tab[2]=1;
if(zad == "1C") tab[3]=1;
if(zad == "2A") tab[4]=1;
if(zad == "2B") tab[5]=1;
if(zad == "2C") tab[6]=1;
if(zad == "3A") tab[7]=1;
if(zad == "3B") tab[8]=1;
if(zad == "3C") tab[9]=1;
if(zad == "4A") tab[10]=1;
if(zad == "4B") tab[11]=1;
if(zad == "4C") tab[12]=1;
if(zad == "5A") tab[13]++;
if(zad == "5B") tab[14]++;
if(zad == "5C") tab[15]++;
}
if(tab[1]==1 and tab[2]==1 and tab[3]==1 and tab[4]==1 and tab[5]==1 and tab[6]==1 and tab[7]==1 and tab[8]==1 and
tab[9]==1 and tab[10]==1 and tab[11]==1 and tab[12]==1 and tab[13]>1 and tab[14]>1 and tab[15]>1) cout << "TAK";
else 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 31 32 33 34 35 36 37 38 | #include <bits/stdc++.h> using namespace std; int tab[20]; int main() { int n; string zad; cin>>n; for(int i=0; i<n;i++ ) { cin>>zad; if(zad == "1A") tab[1]=1; if(zad == "1B") tab[2]=1; if(zad == "1C") tab[3]=1; if(zad == "2A") tab[4]=1; if(zad == "2B") tab[5]=1; if(zad == "2C") tab[6]=1; if(zad == "3A") tab[7]=1; if(zad == "3B") tab[8]=1; if(zad == "3C") tab[9]=1; if(zad == "4A") tab[10]=1; if(zad == "4B") tab[11]=1; if(zad == "4C") tab[12]=1; if(zad == "5A") tab[13]++; if(zad == "5B") tab[14]++; if(zad == "5C") tab[15]++; } if(tab[1]==1 and tab[2]==1 and tab[3]==1 and tab[4]==1 and tab[5]==1 and tab[6]==1 and tab[7]==1 and tab[8]==1 and tab[9]==1 and tab[10]==1 and tab[11]==1 and tab[12]==1 and tab[13]>1 and tab[14]>1 and tab[15]>1) cout << "TAK"; else cout << "NIE"; return 0; } |
English