114732024-10-04 11:32:48gittyBimmbamm (30)cpp11Wrong answer 0/304ms520 KiB
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;

int main()
{
	int n; 
	char word[5];
	//ifstream f("be1.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
base0/30
1Wrong answer0/03ms424 KiB
2Wrong answer0/04ms296 KiB
3Wrong answer0/33ms504 KiB
4Wrong answer0/33ms520 KiB
5Wrong answer0/33ms376 KiB
6Wrong answer0/33ms360 KiB
7Wrong answer0/33ms232 KiB
8Wrong answer0/34ms504 KiB
9Wrong answer0/34ms232 KiB
10Wrong answer0/34ms360 KiB
11Wrong answer0/34ms384 KiB
12Wrong answer0/34ms488 KiB