8062022-01-16 16:35:46HEBimmbamm (30)cpp11Accepted 30/302ms1964 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/02ms1848 KiB
3Accepted3/31ms1912 KiB
4Accepted3/31ms1912 KiB
5Accepted3/31ms1924 KiB
6Accepted3/31ms1924 KiB
7Accepted3/31ms1928 KiB
8Accepted3/31ms1932 KiB
9Accepted3/31ms1932 KiB
10Accepted3/31ms1940 KiB
11Accepted3/31ms1960 KiB
12Accepted3/31ms1964 KiB