199212025-12-30 10:17:02PappMatyasBimmbamm (30)cpp17Accepted 30/301ms556 KiB
#include <iostream>

using namespace std;

int main()
{
	string l;
	int n, res = 0;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> l;
		string cor = "SZAM";
		if (i % 3 == 0)
		{
			if (i % 5 == 0)
			{
				cor = "BUMM";
			}
			else
			{
				cor = "BIMM";
			}
		}
		else
		{
			if (i % 5 == 0)
			{
				cor = "BAMM";
			}
		}
		if (l != cor)
		{
			res = i;
			break;
		}
	}
	cout << res;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/01ms500 KiB
2Accepted0/01ms332 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms316 KiB
8Accepted3/31ms316 KiB
9Accepted3/31ms316 KiB
10Accepted3/31ms316 KiB
11Accepted3/31ms508 KiB
12Accepted3/31ms556 KiB