68212023-12-19 10:38:33madvirBimmbamm (30)cpp17Accepted 30/303ms2992 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, end=0;
    cin >> n;
    string a[n+1];
    string k;

    for(int i=1; i<=n && end==0; i++) {
        cin >> k;
        if(i%3==0) {
            if(i%5==0) {
                if(k!="BUMM") {
                    cout << i;
                    end=1;
                }
            }
            else {
                if(k!="BIMM") {
                    cout << i;
                    end=1;
                }
            }
        }
        else {
            if(i%5==0) {
                if(k!="BAMM") {
                    cout << i;
                    end=1;
                }
            }
            else {
                if(k!="SZAM") {
                    cout << i;
                    end=1;
                }
            }
        }
    }



    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1812 KiB
2Accepted0/03ms2080 KiB
3Accepted3/33ms2268 KiB
4Accepted3/33ms2296 KiB
5Accepted3/33ms2340 KiB
6Accepted3/33ms2560 KiB
7Accepted3/33ms2752 KiB
8Accepted3/33ms2852 KiB
9Accepted3/33ms2848 KiB
10Accepted3/33ms2864 KiB
11Accepted3/33ms2864 KiB
12Accepted3/33ms2992 KiB