210492026-01-12 09:56:46hunzombiBimmbamm (30)cpp17Accepted 30/301ms560 KiB
#include <bits/stdc++.h>
using namespace std;

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

    int n;
    cin >> n;

    int ans = 0;
    for (int i=1; i <= n; i++) {
        string str;
        cin >> str;
        if (ans != 0) continue;
        if (i % 15 == 0) {
            if (str != "BUMM") {
                ans = i;
            }
        } else if (i % 3 == 0) {
            if (str != "BIMM") {
                ans = i;
            }
        } else if (i % 5 == 0) {
            if (str != "BAMM") {
                ans = i;
            }
        } else {
            if (str != "SZAM") {
                ans = i;
            }
        }
    }
    cout << ans << '\n';
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms500 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms548 KiB
8Accepted3/31ms316 KiB
9Accepted3/31ms560 KiB
10Accepted3/31ms316 KiB
11Accepted3/31ms528 KiB
12Accepted3/31ms316 KiB