23912023-01-12 13:34:56DalmBimmbamm (30)cpp11Accepted 30/303ms2996 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%5==0){
        if(szo!="BAMM"){
            cout<<i;
            return 0;
        }
        else{
            continue;
        }
    }
    if(i%3==0){
        if(szo!="BIMM"){
            cout<<i;
            return 0;
        }
        else{
            continue;
        }
    }
    if(i%3!=0&&i%5!=0){
        if(szo!="SZAM"){
            cout<<i;
            return 0;
        }
        else{
            continue;
        }
    }
}




























   cout<<"0";


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1808 KiB
2Accepted0/02ms2136 KiB
3Accepted3/32ms2172 KiB
4Accepted3/32ms2412 KiB
5Accepted3/32ms2608 KiB
6Accepted3/32ms2536 KiB
7Accepted3/32ms2600 KiB
8Accepted3/32ms2792 KiB
9Accepted3/32ms2868 KiB
10Accepted3/32ms2864 KiB
11Accepted3/32ms2864 KiB
12Accepted3/32ms2996 KiB