57512023-09-16 12:32:48AblablablaBimmbamm (30)cpp17Accepted 30/303ms3744 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;

    for(int i = 1; i <= n; i++){
        string a;
        cin >> a;

        if(i % 3 == 0 && i % 5 == 0){
            if(a != "BUMM"){
                cout << i << "\n";
                return 0;
            }
        } else if(i % 5 == 0){
            if(a != "BAMM"){
                cout << i << "\n";
                return 0;
            }
        } else if(i % 3 == 0){
            if(a != "BIMM"){
                cout << i << "\n";
                return 0;
            }
        } else{
            if(a != "SZAM"){
                cout << i << "\n";
                return 0;
            }
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1816 KiB
2Accepted0/03ms2180 KiB
3Accepted3/32ms2380 KiB
4Accepted3/32ms2440 KiB
5Accepted3/33ms2692 KiB
6Accepted3/33ms3060 KiB
7Accepted3/33ms3024 KiB
8Accepted3/33ms3232 KiB
9Accepted3/33ms3476 KiB
10Accepted3/33ms3536 KiB
11Accepted3/33ms3532 KiB
12Accepted3/33ms3744 KiB