125482024-12-21 18:06:45MrkzBimmbamm (30)cpp17Accepted 30/301ms508 KiB
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
char a[1000];
int megoldas,n;
int main()
{
    /*ifstream f("be.in");
    f>>n;*/
    cin>>n;
    for(int i=1;i<=n;i++){
        //f>>a;
        cin>>a;
        if(i%3==0 && i%5!=0 && strstr(a,"BIMM")==NULL && megoldas==0)
            megoldas=i;
        else if(i%3!=0 && i%5==0 && strstr(a,"BAMM")==NULL && megoldas==0)
            megoldas=i;
        else if(i%3==0 && i%5==0 && strstr(a,"BUMM")==NULL && megoldas==0)
            megoldas=i;
        else if(i%3!=0 && i%5!=0 && strstr(a,"SZAM")==NULL && megoldas==0)
            megoldas=i;
    }
    cout<<megoldas;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Accepted3/31ms320 KiB
4Accepted3/31ms320 KiB
5Accepted3/31ms320 KiB
6Accepted3/31ms508 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms320 KiB
9Accepted3/31ms380 KiB
10Accepted3/31ms320 KiB
11Accepted3/31ms320 KiB
12Accepted3/31ms320 KiB