8072022-01-16 16:36:48Halasz EszterBimmbamm (30)cpp11Accepted 30/302ms1972 KiB
#include <iostream>
//#include <fstream>
#include <vector>
#include <string>

using namespace std;

//ifstream cin("bimbammbumm.in");
//ofstream cout("bimbammbumm.out");

int n,i;
string s,ss;

int main()
{
    cin>>n;
    bool f=false;
    for(i=1;i<=n;++i)
    {
        cin>>s;
        if (i%5==0 && i%3==0) ss="BUMM";
        else  if(i%3==0) ss="BIMM";
        else if(i%5==0) ss="BAMM";
        else ss="SZAM";
        if(ss!=s)
        {
            cout<<i;
            f=true;
            break;
        }
    }
    if(f==false)cout<<0;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/02ms1804 KiB
2Accepted0/02ms1864 KiB
3Accepted3/31ms1920 KiB
4Accepted3/31ms1920 KiB
5Accepted3/31ms1928 KiB
6Accepted3/31ms1932 KiB
7Accepted3/31ms1932 KiB
8Accepted3/31ms1940 KiB
9Accepted3/31ms1940 KiB
10Accepted3/31ms1944 KiB
11Accepted3/31ms1964 KiB
12Accepted3/31ms1972 KiB