225372026-01-15 10:47:48SomogyiBimmbamm (30)cpp17Accepted 30/301ms508 KiB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;

    vector<string> szo(n + 1);
    for (int i = 1; i <= n; i++)
    {
        cin >> szo[i];
    }

    for (int i = 1; i <= n; i++)
    {
        if (i % 15 == 0)
        {
            if (szo[i] != "BUMM")
            {
                cout << i;
                return 0;
            }
        }
        else if (i % 5 == 0)
        {
            if (szo[i] != "BAMM")
            {
                cout << i;
                return 0;
            }
        }
        else if (i % 3 == 0)
        {
            if (szo[i] != "BIMM")
            {
                cout << i;
                return 0;
            }
        }
        else
        {
            if (szo[i] != "SZAM")
            {
                cout << i;
                return 0;
            }
        }
    }

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