#include <cstdlib>
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main()
{
std::map < string, int > mapa;
int n;
cin >> n;
string word;
for (int i = 0;i < n;i++)
{
cin >> word;
++mapa[word];
}
if (mapa["1A"] > 0 && mapa["1B"] > 0 && mapa["1C"] > 0 &&
mapa["2A"] > 0 && mapa["2B"] > 0 && mapa["2C"] > 0 &&
mapa["3A"] > 0 && mapa["3B"] > 0 && mapa["3C"] > 0 &&
mapa["4A"] > 0 && mapa["4B"] > 0 && mapa["4C"] > 0 &&
mapa["5A"] > 1 && mapa["5B"] > 1 && mapa["5C"] > 1)
{
cout << "TAK" << endl;
}
else
{
cout << "NIE" << endl;
}
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 <cstdlib> #include <iostream> #include <string> #include <map> using namespace std; int main() { std::map < string, int > mapa; int n; cin >> n; string word; for (int i = 0;i < n;i++) { cin >> word; ++mapa[word]; } if (mapa["1A"] > 0 && mapa["1B"] > 0 && mapa["1C"] > 0 && mapa["2A"] > 0 && mapa["2B"] > 0 && mapa["2C"] > 0 && mapa["3A"] > 0 && mapa["3B"] > 0 && mapa["3C"] > 0 && mapa["4A"] > 0 && mapa["4B"] > 0 && mapa["4C"] > 0 && mapa["5A"] > 1 && mapa["5B"] > 1 && mapa["5C"] > 1) { cout << "TAK" << endl; } else { cout << "NIE" << endl; } return 0; } |
English