207812026-01-08 21:27:13BalázsBimmbamm (30)cpp17Accepted 30/302ms556 KiB
#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    vector<string>bemondasok(n);
    for(int i=0; i<n; i++){
        cin>>bemondasok[i];
    }
    for(int i=0; i<n; i++){
            int szam=i+1;
            string elvart;
        if(szam%15==0){ elvart="BUMM";
        }
        else if(szam%3==0){ elvart="BIMM";
        }
        else if(szam%5==0){ elvart="BAMM";
        }
        else elvart="SZAM";

        if(bemondasok[i]!= elvart){
            cout<<szam<<endl;
            return 0;

        }
    }


    cout<<"0"<<endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms508 KiB
8Accepted3/32ms556 KiB
9Accepted3/31ms316 KiB
10Accepted3/31ms316 KiB
11Accepted3/31ms316 KiB
12Accepted3/31ms500 KiB