202262026-01-05 16:02:07pocsaybBimmbamm (30)cpp17Runtime error 0/301ms316 KiB
#include <iostream>
#include <string>

using namespace std;
using ll = long long;

string correctAns(ll& index) {
    
    if (!(index % 3 == 0) && !(index % 5 == 0)) {
        return "SZAM";
    }
    else if (index % 3 == 0 && !(index % 5 == 0)) {
        return "BIMM";
    }
    else if (!(index % 3 == 0) && (index % 5 == 0)) {
        return "BAMM";
    }
    else if ((index % 3 == 0) && (index % 5 == 0)) {
        return "BUMM";
    }
    
}
int main()
{
    ll lenghtOfGame;
    cin >> lenghtOfGame;
    string input;
    for (ll i = 1; i <= lenghtOfGame; i++) {
        cin >> input;
        if (input != correctAns(i)) {
            cout << i;
            return 1;
        }
    }
    cout << 0;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/30
1Runtime error0/01ms316 KiB
2Runtime error0/01ms316 KiB
3Runtime error0/31ms316 KiB
4Runtime error0/31ms316 KiB
5Runtime error0/31ms316 KiB
6Runtime error0/31ms316 KiB
7Runtime error0/31ms316 KiB
8Runtime error0/31ms316 KiB
9Runtime error0/31ms316 KiB
10Runtime error0/31ms316 KiB
11Runtime error0/31ms316 KiB
12Runtime error0/31ms316 KiB