237622026-01-28 19:26:08FoTamasBimmbamm (30)cpp11Elfogadva 30/301ms508 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;
        }
    }
    cout << 1000;

    return 0;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base30/30
1Elfogadva0/01ms316 KiB
2Elfogadva0/01ms316 KiB
3Elfogadva3/31ms508 KiB
4Elfogadva3/31ms316 KiB
5Elfogadva3/31ms316 KiB
6Elfogadva3/31ms316 KiB
7Elfogadva3/31ms316 KiB
8Elfogadva3/31ms316 KiB
9Elfogadva3/31ms316 KiB
10Elfogadva3/31ms360 KiB
11Elfogadva3/31ms316 KiB
12Elfogadva3/31ms316 KiB