74482024-01-09 09:01:43BenedekMartonBimmbamm (30)cpp17Wrong answer 0/303ms3312 KiB
#include <iostream>
#include <cstring>
#include <fstream>

using namespace std;

int main()
{
    ofstream cout("ki.txt");
    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
base0/30
1Wrong answer0/03ms2088 KiB
2Wrong answer0/03ms2236 KiB
3Wrong answer0/33ms2440 KiB
4Wrong answer0/33ms2564 KiB
5Wrong answer0/33ms2652 KiB
6Wrong answer0/33ms2652 KiB
7Wrong answer0/33ms2784 KiB
8Wrong answer0/33ms2864 KiB
9Wrong answer0/33ms2996 KiB
10Wrong answer0/33ms3064 KiB
11Wrong answer0/33ms3196 KiB
12Wrong answer0/33ms3312 KiB