7392022-01-03 16:47:38kismartongBimmbamm (30)cpp14Accepted 30/303ms2012 KiB
#include <bits/stdc++.h>
using namespace std;

int meg(vector<string> sek, int n) {
	string e;
	for (int i = 1; i <= n; i++) {
		if (i % 3 == 0 && i % 5 == 0)
			e = "BUMM";
		else if (i % 3 == 0)
			e = "BIMM";
		else if (i % 5 == 0)
			e = "BAMM";
		else
			e = "SZAM";
		if (sek[i-1] != e)
			return i;
	}
	return 0;
}

int main() {
	int n;
	string s;
	vector<string> sek;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s;
		sek.push_back(s);
	}
	cout << meg(sek, n) << '\n';
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1780 KiB
2Accepted0/02ms2012 KiB
3Accepted3/31ms1848 KiB
4Accepted3/31ms1844 KiB
5Accepted3/32ms1868 KiB
6Accepted3/32ms1872 KiB
7Accepted3/32ms1880 KiB
8Accepted3/32ms1904 KiB
9Accepted3/32ms1908 KiB
10Accepted3/31ms1964 KiB
11Accepted3/31ms1980 KiB
12Accepted3/31ms1984 KiB