#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<vector<int>> problemCount(5, vector<int>(3));
int n;
cin >> n;
string input;
for (int i = 0; i < n; i++)
{
cin >> input;
problemCount[input[0] - 49][input[1] - 65]++;
}
for (int i = 0; i < problemCount.size(); i++)
{
for (int j = 0; j < problemCount[i].size(); j++)
{
if ((i != 4 && problemCount[i][j] < 1) || (i == 4 && problemCount[i][j] < 2))
{
cout << "NIE";
return 0;
}
}
}
cout << "TAK";
}
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> #include <vector> #include <string> using namespace std; int main() { vector<vector<int>> problemCount(5, vector<int>(3)); int n; cin >> n; string input; for (int i = 0; i < n; i++) { cin >> input; problemCount[input[0] - 49][input[1] - 65]++; } for (int i = 0; i < problemCount.size(); i++) { for (int j = 0; j < problemCount[i].size(); j++) { if ((i != 4 && problemCount[i][j] < 1) || (i == 4 && problemCount[i][j] < 2)) { cout << "NIE"; return 0; } } } cout << "TAK"; } |
English