74392024-01-09 08:37:56BenedekMartonBimmbamm (30)cpp17Wrong answer 3/303ms2756 KiB
#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    int n;
    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)
            {
                cout << i;
                lezaro=1;
            }
        }
        else if(strcmp(x, "BIMM")==0)
        {
            if(i%3!=0 or i%5==0)
            {
                cout << i;
                lezaro=1;
            }
        }
        else if(strcmp(x, "BAMM")==0)
        {
            if(i%3==0 or i%5!=0)
            {
                cout << i;
                lezaro=1;
            }
        }
        else if(strcmp(x, "BUMM")==0)
        {
            if(!i%3==0 or i%5!=0)
            {
                cout << i;
                lezaro=1;
            }
        }
        }
    }
    if(lezaro==0)
    {
        cout << 0;
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/30
1Accepted0/03ms1880 KiB
2Wrong answer0/03ms2068 KiB
3Wrong answer0/33ms2280 KiB
4Wrong answer0/33ms2388 KiB
5Accepted3/33ms2568 KiB
6Wrong answer0/33ms2648 KiB
7Wrong answer0/33ms2756 KiB
8Wrong answer0/33ms2704 KiB
9Wrong answer0/33ms2680 KiB
10Wrong answer0/33ms2676 KiB
11Wrong answer0/33ms2676 KiB
12Wrong answer0/33ms2676 KiB