#include <iostream> #include <map> using namespace std; map<string, int> examples; int main() { ios::sync_with_stdio(false); for (char j = 'A'; j <= 'C'; ++j) { for (char i = '1'; i < '5'; ++i) { string s; s += i; s += j; examples[s] = -1; } string s; s += '5'; s += j; examples[s] = -2; } int n; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; examples[s] += 1; } for (const auto& e : examples) { if (e.second < 0) { cout << "NIE" << endl; exit(0); } } cout << "TAK" << endl; }
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 39 | #include <iostream> #include <map> using namespace std; map<string, int> examples; int main() { ios::sync_with_stdio(false); for (char j = 'A'; j <= 'C'; ++j) { for (char i = '1'; i < '5'; ++i) { string s; s += i; s += j; examples[s] = -1; } string s; s += '5'; s += j; examples[s] = -2; } int n; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; examples[s] += 1; } for (const auto& e : examples) { if (e.second < 0) { cout << "NIE" << endl; exit(0); } } cout << "TAK" << endl; } |