29522023-02-05 19:56:14lazingergoBimmbamm (30)cpp17Wrong answer 27/303ms3232 KiB
#include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <cctype>
#include <cstdlib>
#include <iomanip>
#include <math.h>


using namespace std;

#define ull unsigned long long
#define ll long long

const int I_INF = INT_MAX;
const ll LL_INF = LLONG_MAX;
const ull ULL_INF = ULLONG_MAX;




void solve()
{
	int n;
	cin >> n;

	string s;
	int hiba=-1;
	for (int i = 1; i <= n; i++)
	{
		cin >> s;
		if (not (i % 3 == 0 && s == "BIMM" || i % 5 == 0 && s == "BAMM" || i % 3 == 0 && i % 5 == 0 && s == "BUMM" || i % 3 != 0 && i % 5 != 0 && s == "SZAM"))
		{
			hiba = i;
			break;
		}
	}

	if (hiba == -1)
		cout << 0;
	else 
		cout << hiba;



}



int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	solve();
	return 0;
}

SubtaskSumTestVerdictTimeMemory
base27/30
1Accepted0/03ms1684 KiB
2Accepted0/03ms1848 KiB
3Accepted3/33ms2064 KiB
4Accepted3/33ms2300 KiB
5Accepted3/33ms2512 KiB
6Accepted3/33ms2840 KiB
7Accepted3/33ms2844 KiB
8Accepted3/33ms2964 KiB
9Accepted3/33ms3024 KiB
10Accepted3/32ms3108 KiB
11Accepted3/33ms3232 KiB
12Wrong answer0/33ms3204 KiB