29512023-02-05 19:55:07lazingergoBimmbamm (30)cpp17Wrong answer 27/303ms3476 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;
	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;
		}
	}

	cout << hiba;



}



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

	solve();
	return 0;
}

SubtaskSumTestVerdictTimeMemory
base27/30
1Accepted0/03ms1812 KiB
2Accepted0/03ms2060 KiB
3Accepted3/32ms2140 KiB
4Accepted3/33ms2220 KiB
5Accepted3/33ms2428 KiB
6Accepted3/32ms2508 KiB
7Accepted3/33ms2752 KiB
8Accepted3/33ms2968 KiB
9Accepted3/33ms3212 KiB
10Accepted3/32ms3264 KiB
11Accepted3/33ms3388 KiB
12Wrong answer0/33ms3476 KiB