63372023-11-20 11:05:14GervidBimmbamm (30)cpp17Accepted 30/303ms3844 KiB
#include <iostream>

using namespace std;

int main()
{
	int n, i;
	cin >> n;

	string in;

	for (i = 1; i <= n; i++)
	{
		cin >> in;

		if (i % 3 == 0)
		{
			if (i % 5 == 0)
			{
				if (in != "BUMM")
				{
					cout << i;
					return 0;
				}
			}
			else
			{
				if (in != "BIMM")
				{
					cout << i;
					return 0;
				}
			}
		}
		else
		{
			if (i % 5 == 0)
			{
				if (in != "BAMM")
				{
					cout << i;
					return 0;
				}
			}
			else
			{
				if (in != "SZAM")
				{
					cout << i;
					return 0;
				}
			}
		}
	}
	cout << 0;
}
//16
//SZAM
//SZAM
//BIMM
//SZAM
//BAMM
//BIMM
//SZAM
//SZAM
//BIMM
//BAMM
//SZAM
//BIMM
//SZAM
//SZAM
//BUMM
//SZAM
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1816 KiB
2Accepted0/03ms2192 KiB
3Accepted3/33ms2280 KiB
4Accepted3/33ms2340 KiB
5Accepted3/33ms2540 KiB
6Accepted3/33ms2776 KiB
7Accepted3/33ms2988 KiB
8Accepted3/33ms3172 KiB
9Accepted3/33ms3256 KiB
10Accepted3/33ms3384 KiB
11Accepted3/33ms3460 KiB
12Accepted3/33ms3844 KiB