29212023-02-04 14:12:01horvathabelBimmbamm (30)cpp17Accepted 30/303ms3596 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin>>n;
	for (int i=1;i<=n;i++){
		string x;
		cin>>x; 
		if (i%3==0 && i%5!=0){
			if (x!="BIMM"){
				cout<<i;
				return 0; 
			}
		} 
		if (i%3!=0 && i%5==0){
			if (x!="BAMM"){
				cout<<i;
				return 0; 
			}
		}
		if (i%3==0 && i%5==0){
			if (x!="BUMM"){
				cout<<i;
				return 0; 
			}
		}
		if (i%3!=0 and i%5!=0){
			if (x!="SZAM"){
				cout<<i;
				return 0; 
			}
		}
	}
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1808 KiB
2Accepted0/03ms1900 KiB
3Accepted3/33ms2104 KiB
4Accepted3/33ms2312 KiB
5Accepted3/33ms2524 KiB
6Accepted3/33ms2612 KiB
7Accepted3/33ms2740 KiB
8Accepted3/33ms2948 KiB
9Accepted3/32ms3036 KiB
10Accepted3/33ms3172 KiB
11Accepted3/33ms3380 KiB
12Accepted3/33ms3596 KiB