74442024-01-09 08:44:44BenedekMartonBimmbamm (30)cpp14Wrong answer 3/303ms3572 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/03ms1872 KiB
2Wrong answer0/03ms2124 KiB
3Wrong answer0/33ms2336 KiB
4Wrong answer0/33ms2364 KiB
5Accepted3/33ms2608 KiB
6Wrong answer0/33ms2820 KiB
7Wrong answer0/33ms3032 KiB
8Wrong answer0/33ms3120 KiB
9Wrong answer0/33ms3248 KiB
10Wrong answer0/33ms3456 KiB
11Wrong answer0/33ms3424 KiB
12Wrong answer0/33ms3572 KiB