202272026-01-05 16:03:09pocsaybBimmbamm (30)cpp17Accepted 30/301ms552 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 0;
        }
    }
    cout << 0;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/01ms316 KiB
2Accepted0/01ms552 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms316 KiB
8Accepted3/31ms316 KiB
9Accepted3/31ms316 KiB
10Accepted3/31ms316 KiB
11Accepted3/31ms316 KiB
12Accepted3/31ms316 KiB