76912024-01-10 13:24:29szabelrBimmbamm (30)cpp17Wrong answer 21/303ms3696 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, hol = 1, rossz=0,cucc=1;
    cin >> n;
    string x;
    for (int i = 1; i <= n and cucc==1; i++) {
        cin >> x;
        if (hol % 3 != 0 and hol % 5 != 0 and x == "BIMM" and cucc==1)
        {
            cout << i;
            cucc = 0;
        }
        
        if (hol % 3 != 0 and hol % 5 != 0 and x == "BUMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 != 0 and hol % 5 != 0 and x == "BAMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 == 0 and hol % 5 != 0 and x == "BUMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 == 0 and hol % 5 != 0 and x == "BAMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 == 0 and hol % 5 == 0 and x == "BAMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 == 0 and hol % 5 == 0 and x == "BIMM" and cucc == 1)
        {
            cout <<i;
            cucc = 0;
        }
        if (hol % 3 != 0 and hol % 5 == 0 and x == "BUMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        if (hol % 3 != 0 and hol % 5 == 0 and x == "BIMM" and cucc == 1)
        {
            cout << i;
            cucc = 0;
        }
        
        hol++;
    }
    //cout << rossz - 1;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base21/30
1Accepted0/03ms1812 KiB
2Accepted0/03ms2056 KiB
3Accepted3/33ms2216 KiB
4Accepted3/33ms2424 KiB
5Accepted3/33ms2676 KiB
6Wrong answer0/33ms2884 KiB
7Accepted3/33ms2984 KiB
8Accepted3/33ms3060 KiB
9Wrong answer0/33ms3272 KiB
10Accepted3/33ms3484 KiB
11Wrong answer0/33ms3576 KiB
12Accepted3/33ms3696 KiB