114742024-10-04 11:35:25gittyBimmbamm (30)cpp11Accepted 30/303ms512 KiB
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;

int main()
{
	int n; 
	char word[5];
	//ifstream f("be2.txt");
	cin >> n;
	//f >> n;
	bool kilep = false;
	int elso = 0;
	cin.get();
	for (int i = 1; i <= n; i++)
	{
		
		cin.getline(word, 5);
		//cout<< word << i << endl;
		if (i % 3 == 0 &&  i % 5 == 0)
		{
			if (word[0] != 'B' || word[1] != 'U')
			{
				kilep = true;
			}
		}
		else
		{
			if (i % 3 == 0)
			{
				if (word[0] != 'B' || word[1] != 'I'){
					kilep = true;
				}

			}
			else
			{
				if (i % 5 == 0 )
				{
					if(word[0] != 'B' || word[1] != 'A')
					kilep = true;
				}
				else
				{
					if (word[0] != 'S')
					{
						kilep = true;
					}
				}
			}

		}
		if (kilep && elso == 0)
		{
			elso = i;
		}
	}
	cout << elso;
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms360 KiB
2Accepted0/03ms408 KiB
3Accepted3/33ms424 KiB
4Accepted3/33ms512 KiB
5Accepted3/33ms504 KiB
6Accepted3/33ms376 KiB
7Accepted3/33ms508 KiB
8Accepted3/33ms376 KiB
9Accepted3/32ms256 KiB
10Accepted3/33ms360 KiB
11Accepted3/33ms360 KiB
12Accepted3/33ms384 KiB