20212022-12-15 08:35:26gkataBimmbamm (30)cpp17Accepted 30/303ms3764 KiB
#include <iostream>
//#include <fstream>
#include <string>

using namespace std;

//ifstream cin("bimm.in");
//ofstream cout("bimm.out");

string s;
int i,n,db;

int main()
{
    cin>>n;
    for(i=1;i<=n;++i)
    {
        cin>>s;
        if(i%3==0 && i%5==0)
        {
            if(s[1]!='U')
            {
                cout<<i;
                ++db;
                break;
            }
        }

            else if(i%3==0)
            {
                if(s[1]!='I')
                {
                    cout<<i;
                    ++db;
                    break;
                }
            }

            else if(i%5==0)
            {
                if(s[1]!='A')
                {
                    cout<<i;
                    ++db;
                    break;
                }
            }

            else if(s[0]!='S')
                {
                    cout<<i;
                    ++db;
                    break;
                }
    }

    if(db==0) cout<<0;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1872 KiB
2Accepted0/02ms2120 KiB
3Accepted3/32ms2328 KiB
4Accepted3/32ms2532 KiB
5Accepted3/32ms2604 KiB
6Accepted3/32ms2848 KiB
7Accepted3/32ms2996 KiB
8Accepted3/32ms3200 KiB
9Accepted3/32ms3400 KiB
10Accepted3/32ms3564 KiB
11Accepted3/32ms3640 KiB
12Accepted3/32ms3764 KiB