122902024-12-11 12:51:10ruffbrigiBimmbamm (30)cpp17Accepted 30/301ms320 KiB
#include <iostream>

using namespace std;

int main()
{
    int n,i;
    cin>>n;
    string s,t;
    bool ok=true;
    for(i=1;i<=n && ok;i++)
    {
        cin>>s;
        if(i%3==0 && i%5==0) t="BUMM";
        else if(i%3==0) t="BIMM";
            else if(i%5==0) t="BAMM";
                else t="SZAM";
        if(s!=t) ok=false;
    }
    if(ok) cout<<0;
    else cout<<i-1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Accepted3/31ms320 KiB
4Accepted3/31ms320 KiB
5Accepted3/31ms320 KiB
6Accepted3/31ms320 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms320 KiB
9Accepted3/31ms320 KiB
10Accepted3/31ms320 KiB
11Accepted3/31ms320 KiB
12Accepted3/31ms320 KiB