7432022-01-04 13:22:45Valaki2Benzinkút üzemeltetés (55)cpp14Wrong answer 0/553ms4168 KiB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second

string jo(int x) {
    int res = 0;
    if(x % 3 == 0 && x % 5 == 0) return "BUMM";
    if(x % 3 == 0) return "BIMM";
    if(x % 5 == 0) return "BAMM";
    return "SZAM";
}

void solve() {
    int n;
    cin >> n;
    vector<string> v(1 + n, "");
    for(int i = 1; i <= n; i++) {
        cin >> v[i];
        if(v[i] != jo(i)) {
            cout << i << "\n";
            return;
        }
    }
    cout << "0\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    // int T = 1; cin >> T; while(T--)// !!!!!
    solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/55
1Wrong answer0/03ms1836 KiB
2Wrong answer0/03ms2216 KiB
3Wrong answer0/33ms2260 KiB
4Wrong answer0/33ms2472 KiB
5Wrong answer0/33ms2672 KiB
6Wrong answer0/33ms2904 KiB
7Wrong answer0/33ms3124 KiB
8Wrong answer0/33ms3208 KiB
9Wrong answer0/33ms3200 KiB
10Wrong answer0/33ms3428 KiB
11Wrong answer0/33ms3540 KiB
12Wrong answer0/32ms3636 KiB
13Wrong answer0/43ms3624 KiB
14Wrong answer0/42ms3628 KiB
15Wrong answer0/53ms3964 KiB
16Wrong answer0/63ms4168 KiB
17Wrong answer0/63ms4020 KiB