18522022-12-05 12:36:07BenceBimmbamm (30)cpp11Accepted 30/303ms3368 KiB
#include <iostream>
#include <string>
using namespace std;

int n,i;
string s;

int main()
{
    cin>>n;

    for(i=1; i<=n; ++i)
    {
        cin>>s;
        if(i%15==0){ if( s!="BUMM"){
            cout<<i;
            return 0;}
        }else if(i%3==0){ if(s!="BIMM"){
            cout<<i;
            return 0;
        }}else if(i%5==0) { if(s!="BAMM")
        {
            cout<<i;
            return 0;
        }}else if(s!="SZAM"){
            cout<<i;
            return 0;
        }
    }
    cout<<0;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1872 KiB
2Accepted0/02ms2128 KiB
3Accepted3/32ms2364 KiB
4Accepted3/32ms2532 KiB
5Accepted3/32ms2720 KiB
6Accepted3/32ms2968 KiB
7Accepted3/32ms2960 KiB
8Accepted3/32ms3080 KiB
9Accepted3/32ms3328 KiB
10Accepted3/32ms3284 KiB
11Accepted3/32ms3292 KiB
12Accepted3/32ms3368 KiB