121912024-12-06 20:23:30szasztundeBimmbamm (30)cpp17Accepted 30/301ms552 KiB
#include <iostream>

using namespace std;

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