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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>

void szukanie(std::string tablica[], std::string tablica2[], int i, int &counter, int n)
{
	for (int j = 0; j < n; j++)
	{
		if (tablica[j] == tablica2[i])
			counter++;
	}
}


int main()
{
	int n;
	std::cin >> n;
	std::string *tablica = new std::string[n];

	for (int i = 0; i < n; i++)
	{
		std::cin >> tablica[i];
	}

	std::string tablica2[15] = { "1A", "1B", "1C", "2A", "2B", "2C", "3A", "3B", "3C", "4A", "4B", "4C", "5A", "5B", "5C" };

	bool znalezione = false;
	int counter = 0;
	for (int i = 0; i < 12; i++)
	{
		counter = 0;
		szukanie(tablica, tablica2, i, counter, n);
		if (counter >= 1)
			znalezione = true;
		else
		{
			znalezione = false;
			break;
		}
	}

	if (znalezione == true)
	{
		for (int i = 12; i < 15; i++)
		{
			counter = 0;
			szukanie(tablica, tablica2, i, counter, n);
			if (counter >= 2)
				znalezione = true;
			else
			{
				znalezione = false;
				break;
			}
		}
	}

	if (znalezione == true)
		std::cout << "TAK";
	else
		std::cout << "NIE";

	delete[] tablica;

	return 0;
}