#include <iostream> using namespace std; int main() { int n; cin >> n; if (n < 18) { cout << "NIE" << endl; return 0; } int t[5][3] = { {0,0,0},{0,0,0},{0,0,0},{0,0,0},{-1,-1,-1} }; int d = 0; char l; int x, y; while (n--) { cin >> x; x--; cin >> l; y = l - 'A'; if (t[x][y] == 0) d++; t[x][y]++; } if (d == 15) 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 | #include <iostream> using namespace std; int main() { int n; cin >> n; if (n < 18) { cout << "NIE" << endl; return 0; } int t[5][3] = { {0,0,0},{0,0,0},{0,0,0},{0,0,0},{-1,-1,-1} }; int d = 0; char l; int x, y; while (n--) { cin >> x; x--; cin >> l; y = l - 'A'; if (t[x][y] == 0) d++; t[x][y]++; } if (d == 15) cout << "TAK"; else cout << "NIE"; return 0; } |