25682023-01-17 14:48:11pyramisBimmbamm (30)cpp11Accepted 30/303ms3192 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/03ms1808 KiB
2Accepted0/02ms2012 KiB
3Accepted3/32ms2084 KiB
4Accepted3/32ms2208 KiB
5Accepted3/32ms2540 KiB
6Accepted3/32ms2628 KiB
7Accepted3/32ms2828 KiB
8Accepted3/32ms3084 KiB
9Accepted3/32ms3192 KiB
10Accepted3/32ms3148 KiB
11Accepted3/32ms3156 KiB
12Accepted3/32ms3156 KiB