35872023-03-01 09:15:09UnluckYBimmbamm (30)cpp11Accepted 30/303ms3232 KiB
#include <bits/stdc++.h>

using namespace std;

int main(){


    int n; cin >> n;

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



        if (i % 15 == 0 && x != "BUMM"){cout << i; break;}
        else if (i % 3 == 0 && i % 15 != 0 && x != "BIMM"){cout << i; break;}
        else if (i % 5 == 0 && i % 15 != 0 && x != "BAMM"){cout << i; break;}
        else if (i % 3 != 0 && i % 5 != 0 && x != "SZAM"){cout << i; break;}

        if (i == n) cout << 0;

    }

    string s;
    while (cin>>s);





    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1680 KiB
2Accepted0/03ms1932 KiB
3Accepted3/33ms2232 KiB
4Accepted3/33ms2280 KiB
5Accepted3/33ms2624 KiB
6Accepted3/33ms2652 KiB
7Accepted3/33ms2936 KiB
8Accepted3/33ms2776 KiB
9Accepted3/33ms2868 KiB
10Accepted3/33ms3232 KiB
11Accepted3/33ms3164 KiB
12Accepted3/33ms3168 KiB