74372024-01-09 08:32:34BenedekMartonBimmbamm (30)cpp17Wrong answer 3/303ms3244 KiB
#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    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
base3/30
1Accepted0/03ms1876 KiB
2Wrong answer0/03ms2120 KiB
3Wrong answer0/32ms2156 KiB
4Wrong answer0/33ms2396 KiB
5Accepted3/32ms2364 KiB
6Wrong answer0/33ms2492 KiB
7Wrong answer0/33ms2724 KiB
8Wrong answer0/33ms2784 KiB
9Wrong answer0/33ms3036 KiB
10Wrong answer0/33ms3116 KiB
11Wrong answer0/33ms3148 KiB
12Wrong answer0/33ms3244 KiB