33472023-02-26 22:12:41nkdorka1212Bimmbamm (30)cpp17Accepted 30/303ms3564 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int ront=0;
    for(int i=1;i<=n;i++)
    {
        string s;
        cin>>s;
        if(i%3==0 && i%5==0 && s!="BUMM" && ront==0)
        {
            ront=i;
        }else if(i%3==0 && i%5!=0 && s!="BIMM" && ront==0)
        {
            ront=i;
        }else if(i%3!=0 && i%5==0 && s!="BAMM" && ront==0)
        {
            ront=i;
        }else if(i%3!=0 && i%5!=0 && s!="SZAM" && ront==0)
        {
            ront=i;
        }
    }
        cout<<ront<<"\n";

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1680 KiB
2Accepted0/03ms1848 KiB
3Accepted3/33ms2060 KiB
4Accepted3/33ms2304 KiB
5Accepted3/32ms2384 KiB
6Accepted3/33ms2644 KiB
7Accepted3/33ms2800 KiB
8Accepted3/33ms2996 KiB
9Accepted3/33ms3204 KiB
10Accepted3/33ms3252 KiB
11Accepted3/33ms3320 KiB
12Accepted3/33ms3564 KiB