74532024-01-09 09:25:24BenedekMartonJárda-L (40)cpp17Wrong answer 0/403ms3976 KiB
#include <iostream>
#include <cstring>
#include <fstream>

using namespace std;

int main()
{
    //ofstream cout("ki.txt");
    int n;
    char x[5];
    cin >> n;
    for(int i=1; i<=n; i++)
    {
        cin >> x;
        //cout << strcmp(x, "SZAM");
        if(strcmp(x, "SZAM")==0)
        {
            if(i%3==0 or i%5==0)
            {
                cout << i;
                return 0;
            }
        }
        else if(strcmp(x, "BIMM")==0)
        {
            if(i%3!=0 or i%5==0)
            {
                cout << i;
                return 0;
            }
        }
        else if(strcmp(x, "BAMM")==0)
        {
            if(i%3==0 or i%5!=0)
            {
                cout << i;
                return 0;
            }
        }
        else if(strcmp(x, "BUMM")==0)
        {
            if(i%3!=0 or i%5!=0)
            {
                cout << i;
                return 0;
            }
        }
    }
    cout << 0;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/40
1Wrong answer0/03ms1872 KiB
2Wrong answer0/03ms2076 KiB
3Wrong answer0/23ms2284 KiB
4Wrong answer0/23ms2392 KiB
5Wrong answer0/23ms2588 KiB
6Wrong answer0/23ms2956 KiB
7Wrong answer0/23ms2964 KiB
8Wrong answer0/33ms3072 KiB
9Wrong answer0/33ms3056 KiB
10Wrong answer0/33ms3040 KiB
11Wrong answer0/33ms3180 KiB
12Wrong answer0/33ms3372 KiB
13Wrong answer0/33ms3460 KiB
14Wrong answer0/33ms3460 KiB
15Wrong answer0/33ms3592 KiB
16Wrong answer0/33ms3828 KiB
17Wrong answer0/33ms3976 KiB