202242026-01-05 15:45:44pirosmacska10Bimmbamm (30)cpp17Wrong answer 3/301ms532 KiB
#include<iostream>
#include<vector>
#include<algorithm>
#include<climits>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<cmath>


using namespace std;
using ll=long long;


#define endl '\n' 


const ll INF=LLONG_MAX;
const ll MOD=1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    cin >> n;
    int first = 0;
    for(int i = 1; i <= n; i++)  {
        string s;
        cin >> s;
        if(i % 3 == 0) {
            if(i % 5 == 0) {
                if(s != "BUMM") {
                    first = i;
                    break;
                }
            }
            else {
                if(s != "BIMM") {
                    first = i;
                    break;
                }
            }
        }
        else if(i % 5) {
            if(s != "BAMM") {
                first = i;
                break;
            }
        }
        else if(s != "SZAM") {
            first = i;
            break; 
        }
    }
    cout << first << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/30
1Wrong answer0/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/31ms316 KiB
4Wrong answer0/31ms316 KiB
5Accepted3/31ms332 KiB
6Wrong answer0/31ms316 KiB
7Wrong answer0/31ms316 KiB
8Wrong answer0/31ms532 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/31ms316 KiB
11Wrong answer0/31ms532 KiB
12Wrong answer0/31ms316 KiB