74452024-01-09 08:51:06BenedekMartonBimmbamm (30)cpp17Wrong answer 3/303ms3572 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/03ms2068 KiB
3Wrong answer0/33ms2284 KiB
4Wrong answer0/33ms2496 KiB
5Accepted3/33ms2704 KiB
6Wrong answer0/33ms2784 KiB
7Wrong answer0/33ms2932 KiB
8Wrong answer0/33ms3100 KiB
9Wrong answer0/33ms3236 KiB
10Wrong answer0/33ms3476 KiB
11Wrong answer0/33ms3572 KiB
12Wrong answer0/33ms3528 KiB