72772024-01-05 21:13:22gonterarminBimmbamm (30)cpp17Wrong answer 27/303ms3412 KiB
#include <iostream>

using namespace std;

int main() {
    int n,a=0;
    cin>>n;
    string s;
    for (int i = 1; i <= n; ++i) {
        cin>>s;
        a++;
        if (i%3==0 && i%5==0 && s!="BUMM") {cout<<i; break;}
        else if (i%3==0 && i%5==0 && s=="BUMM") continue;
        else if (i%3==0 && s!="BIMM") {cout<<i; break;}
        else if (i%5==0 && s!="BAMM") {cout<<i; break;}
        else if (i%3!=0 && i%5!=0 && s!="SZAM") {cout<<i; break;}
    }
    if (a==n) cout<<0;
}
SubtaskSumTestVerdictTimeMemory
base27/30
1Wrong answer0/03ms1808 KiB
2Accepted0/03ms2064 KiB
3Accepted3/33ms2272 KiB
4Accepted3/33ms2512 KiB
5Accepted3/33ms2728 KiB
6Wrong answer0/33ms2880 KiB
7Accepted3/33ms2972 KiB
8Accepted3/33ms3096 KiB
9Accepted3/33ms3084 KiB
10Accepted3/32ms3088 KiB
11Accepted3/33ms3324 KiB
12Accepted3/33ms3412 KiB