35862023-03-01 09:14:48FulopMateBimmbamm (30)cpp14Accepted 30/303ms3752 KiB
#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n; cin>>n;
    for(int i = 1; i <= n; i++){
        string s; cin>>s;
        if(i%3==0 &&i%5==0){
            if(s != "BUMM"){
                cout<<i<<endl;
                return 0;
            }
        } else if(i%3==0){
            if(s != "BIMM"){
                cout<<i<<endl;
                return 0;
            }
        } else if(i%5==0){
            if(s != "BAMM"){
                cout<<i<<endl;
                return 0;
            }
        } else if (s != "SZAM"){
            cout<<i<<endl;
            return 0;
        }
    }
    cout<<0<<endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1828 KiB
2Accepted0/03ms2060 KiB
3Accepted3/33ms2268 KiB
4Accepted3/32ms2376 KiB
5Accepted3/33ms2548 KiB
6Accepted3/32ms2544 KiB
7Accepted3/33ms2672 KiB
8Accepted3/33ms2876 KiB
9Accepted3/33ms3092 KiB
10Accepted3/33ms3328 KiB
11Accepted3/33ms3540 KiB
12Accepted3/33ms3752 KiB