112062024-07-16 14:23:01matyiBimmbamm (30)cpp17Wrong answer 3/303ms512 KiB
#include <iostream>
#include <fstream>

using namespace std;


void jatek(int &i,int n)
{
    if (i<=n)
    {
        string a;
        cin>>a;
        if(i%3!=0 and i%5!=0)
        {
            if(a!="SZAM")
            {
                cout<<i;
            }
            else
                jatek(i=i+1,n);
        }
        else if(i%3==0)
        {
            if(a!="BIMM")
            {
                cout<<i;
            }
            else
                jatek(i=i+1,n);
        }
        else if(i%5==0)
        {
            if(a!="BAMM")
            {
                cout<<i;
            }
            else
                jatek(i=i+1,n);
        }
        else if(i%3==0 and i%5==0)
        {
            if (a!="BUMM")
            {
                cout<<i;
            }
            else
                jatek(i=i+1,n);
        }

    }
}
int main()
{
    int n,i=1;
    cin>>n;
    jatek(i,n);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/30
1Accepted0/03ms356 KiB
2Wrong answer0/03ms356 KiB
3Wrong answer0/33ms356 KiB
4Wrong answer0/33ms404 KiB
5Accepted3/32ms356 KiB
6Wrong answer0/33ms356 KiB
7Wrong answer0/33ms376 KiB
8Wrong answer0/33ms228 KiB
9Wrong answer0/32ms376 KiB
10Wrong answer0/33ms412 KiB
11Wrong answer0/33ms508 KiB
12Wrong answer0/33ms512 KiB