25752023-01-17 15:23:11LeviRBimmbamm (30)cpp11Accepted 30/303ms3244 KiB
#include <iostream>

using namespace std;

int main()
{
    int N;
    cin>>N;
    string szo;
    for(int i=1; i <= N; i++){
        cin>> szo;

        if (i%15 == 0){
            if(szo != "BUMM"){
            cout<<i;

            return 0;
        }
        else{
        continue;
        }
    }
        if(i%3 == 0){
            if(szo != "BIMM"){
            cout<<i;
            return 0;
            }
        else{
            continue;
        }
    }
        if(i%5 == 0){
            if(szo != "BAMM"){
            cout<<i;
            return 0;
            }
        else{
        continue;
        }
    }
         else if(i%3!=0 && i%5!= 0 && szo != "SZAM"){
            cout<<i;
            return 0;
        }
    }




    return 0;
}


SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1680 KiB
2Accepted0/02ms1844 KiB
3Accepted3/32ms2056 KiB
4Accepted3/32ms2392 KiB
5Accepted3/32ms2524 KiB
6Accepted3/32ms2660 KiB
7Accepted3/32ms2736 KiB
8Accepted3/32ms2856 KiB
9Accepted3/32ms3040 KiB
10Accepted3/32ms3244 KiB
11Accepted3/32ms3212 KiB
12Accepted3/32ms3208 KiB