210482026-01-12 09:54:26hunzombiBimmbamm (30)cpp17Wrong answer 24/301ms344 KiB
#include <bits/stdc++.h>
using namespace std;

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

    int n;
    cin >> n;
    bool w = false;
    for (int i=1; i <= n; i++) {
        string str;
        cin >> str;
        if (w) continue;
        if (i % 15 == 0) {
            if (str != "BUMM") {
                w = true;
            }
        } else if (i % 3 == 0) {
            if (str != "BIMM") {
                cout << i << '\n';
                w = true;
            }
        } else if (i % 5 == 0) {
            if (str != "BAMM") {
                cout << i << '\n';
                w = true;
            }
        } else {
            if (str != "SZAM") {
                cout << i << '\n';
                w = true;
            }
        }
    }
    if (!w) {
        cout << 0 << '\n';
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base24/30
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms316 KiB
8Accepted3/31ms344 KiB
9Wrong answer0/31ms316 KiB
10Accepted3/31ms316 KiB
11Accepted3/31ms316 KiB
12Wrong answer0/31ms316 KiB