234292026-01-22 19:02:47FoTamasBimmbamm (30)cpp17Accepted 30/301ms512 KiB
#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;  // jatek hossza
    cin >> n;

    char bemondasok[1000][5];   // bemondasok
    for(int i=0; i<n; i++)
    {
        cin >> bemondasok[i];
    }

    char helyes[5];     // helyes bemondas
    for (int i = 0; i < n; i++)
    {
        if ((i + 1) % 3 == 0 && (i + 1) % 5 == 0)
            strcpy(helyes, "BUMM");
        else if ((i + 1) % 3 == 0)
            strcpy(helyes, "BIMM");
        else if ((i + 1) % 5 == 0)         // helyes bemondas kigeneralasa
            strcpy(helyes, "BAMM");
        else
            strcpy(helyes, "SZAM");

        if (strcmp(bemondasok[i], helyes) != 0)     // ellenorzes
        {
            cout << i + 1;
            return 0;
        }
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted3/31ms512 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms500 KiB
6Accepted3/31ms372 KiB
7Accepted3/31ms316 KiB
8Accepted3/31ms500 KiB
9Accepted3/31ms316 KiB
10Accepted3/31ms316 KiB
11Accepted3/31ms316 KiB
12Accepted3/31ms316 KiB