#include <iostream>
using namespace std;
int i_pom_tab[200];
int main() {
string liczba;
int i_pom, tym, tem;
bool odp;
odp = true;
cin >> i_pom;
for (int x = 0; x < i_pom; x++){
cin >> liczba;
tym = int(liczba[0]) - 49;
tem = tym * 3 + int(liczba[1]) - 64;
i_pom_tab[tem] += 1;
//i_pom[tym * 3 + int(liczba[1]) - 64] += 1;
}
for (int x = 1; x <= 12; x++){
if (i_pom_tab[x] < 1){
odp = false;
}
}
for (int x = 13; x <= 15; x++){
if (i_pom_tab[x] < 2){
odp = false;
}
}
if (odp){
cout << "TAK\n";
}
else{
cout << "NIE\n";
}
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 | #include <iostream> using namespace std; int i_pom_tab[200]; int main() { string liczba; int i_pom, tym, tem; bool odp; odp = true; cin >> i_pom; for (int x = 0; x < i_pom; x++){ cin >> liczba; tym = int(liczba[0]) - 49; tem = tym * 3 + int(liczba[1]) - 64; i_pom_tab[tem] += 1; //i_pom[tym * 3 + int(liczba[1]) - 64] += 1; } for (int x = 1; x <= 12; x++){ if (i_pom_tab[x] < 1){ odp = false; } } for (int x = 13; x <= 15; x++){ if (i_pom_tab[x] < 2){ odp = false; } } if (odp){ cout << "TAK\n"; } else{ cout << "NIE\n"; } return 0; } |
English