199662025-12-30 16:27:56VargaVivienBimmbamm (30)cpp17Accepted 30/301ms508 KiB
#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    int N;
    cin >> N;
    string be[1001];
    string jo[N + 1];
    for(int i = 1; i <= N; i++)
    {
        cin >> be[i];
    }
    for(int i = 1; i <= N; i++)
    {
        if(i % 3 == 0)
        {
            jo[i] = "BIMM";
            if (i % 5 == 0)
            {
                jo[i] = "BUMM";
            }
        }
        else
        {
            if (i % 5 == 0)
            {
                jo[i] = "BAMM";
            }
            else
            {
                jo[i] = "SZAM";
            }
        }
    }
    int i = 1, c = 0;
    while (i <= N)
    {
        if(be[i] != jo[i])
        {
            c = i;
            break;
        }
        i++;
    }
        cout << c;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/01ms508 KiB
2Accepted0/01ms316 KiB
3Accepted3/31ms500 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms348 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms316 KiB
8Accepted3/31ms316 KiB
9Accepted3/31ms316 KiB
10Accepted3/31ms456 KiB
11Accepted3/31ms332 KiB
12Accepted3/31ms336 KiB