69982023-12-25 10:11:16MagyarKendeSZLGBimmbamm (30)cpp17Accepted 30/303ms3524 KiB
#include <iostream>
#include <string>
using namespace std;
#define speed cin.tie(0); ios::sync_with_stdio(0)

int main() {
    speed;
    
    int N;
    cin >> N;
    string s;
    int i = 1;
    for (int i = 1, found = 0; i <= N; i++) {
        cin >> s;
        if (!found) {
            string correct = (
                i % 3 == 0 && i % 5 == 0 ? "BUMM" : 
                i % 5 == 0 ? "BAMM" : 
                i % 3 == 0 ? "BIMM" : 
                "SZAM"
            );
            if (s != correct) {
                cout << i;
                found = 1;
            }
        }
    }
    
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1824 KiB
2Accepted0/03ms2024 KiB
3Accepted3/33ms2248 KiB
4Accepted3/33ms2460 KiB
5Accepted3/33ms2664 KiB
6Accepted3/33ms2888 KiB
7Accepted3/33ms2952 KiB
8Accepted3/33ms3080 KiB
9Accepted3/33ms3184 KiB
10Accepted3/33ms3308 KiB
11Accepted3/33ms3376 KiB
12Accepted3/33ms3524 KiB