23372023-01-10 15:29:28NandikaaBimmbamm (30)cpp11Accepted 30/303ms3384 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;}
        continue;
    }
    if (i%3 == 0){
            if(szo != "BIMM"){
                cout << i;
                return 0;
            }
            continue;
        }
        if (i%5 == 0){
                if ( szo != "BAMM"){
                    cout << i;
                    return 0;}
        continue;
    }
    if(i%3 != 0 && i%5 != 0 && szo != "SZAM"){
        cout << i;
        return 0;
    }
    }
    cout << 0;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1680 KiB
2Accepted0/02ms1844 KiB
3Accepted3/32ms2092 KiB
4Accepted3/32ms2296 KiB
5Accepted3/32ms2504 KiB
6Accepted3/32ms2752 KiB
7Accepted3/32ms2952 KiB
8Accepted3/32ms3116 KiB
9Accepted3/32ms3144 KiB
10Accepted3/32ms3144 KiB
11Accepted3/32ms3152 KiB
12Accepted3/32ms3384 KiB