74422024-01-09 08:42:51BenedekMartonBimmbamm (30)cpp17Wrong answer 3/303ms3288 KiB
#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    int n, k;
    char x[5];
    cin >> n;
    bool lezaro=0;
    for(int i=1; i<=n; i++)
    {
        cin >> x;
        if(lezaro==0){
        if(strcmp(x, "SZAM")==0)
        {
            if(i%3==0 or i%5==0)
            {
                k= i;
                lezaro=1;
            }
        }
        else if(strcmp(x, "BIMM")==0)
        {
            if(i%3!=0 or i%5==0)
            {
                k= i;
                lezaro=1;
            }
        }
        else if(strcmp(x, "BAMM")==0)
        {
            if(i%3==0 or i%5!=0)
            {
                k= i;
                lezaro=1;
            }
        }
        else if(strcmp(x, "BUMM")==0)
        {
            if(!i%3==0 or i%5!=0)
            {
                k= i;
                lezaro=1;
            }
        }
        }
    }
    if(lezaro==0)
    {
        cout << 0;
    }
    else
    {
        cout << k;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/30
1Accepted0/03ms1880 KiB
2Wrong answer0/03ms2116 KiB
3Wrong answer0/32ms2196 KiB
4Wrong answer0/33ms2328 KiB
5Accepted3/33ms2544 KiB
6Wrong answer0/33ms2752 KiB
7Wrong answer0/33ms2832 KiB
8Wrong answer0/33ms2836 KiB
9Wrong answer0/33ms2964 KiB
10Wrong answer0/33ms3048 KiB
11Wrong answer0/33ms3288 KiB
12Wrong answer0/33ms3212 KiB