15152022-11-21 21:19:33kicsiboglarBimmbamm (30)cpp11Accepted 30/303ms3516 KiB
#include <iostream>
#include <vector>
#include <string>

#define ll long long
using namespace std;

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

ll n,m,i,j,a,b,k;
string s;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    cin>>n;
    for (i=1;i<=n;++i)
    {
        cin>>s;
        if (i%3==0&&i%5==0)
        {
            if (s[1]!='U') 
            {
                cout<<i;
                return 0;
            }
        }
        else if (i%3==0)
        {
            if (s[1]!='I')
            {
                cout<<i;
                return 0;
            }
        }
        else if (i%5==0)
        {
            if (s[1]!='A')
            {
                cout<<i;
                return 0;
            }
        }
        else if (s[0]!='S') 
        {
            cout<<i;
            return 0;
        }
    }
    cout<<"0";
}
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/03ms1760 KiB
2Accepted0/02ms2000 KiB
3Accepted3/32ms2148 KiB
4Accepted3/32ms2504 KiB
5Accepted3/32ms2692 KiB
6Accepted3/32ms2892 KiB
7Accepted3/32ms3080 KiB
8Accepted3/32ms3164 KiB
9Accepted3/32ms3296 KiB
10Accepted3/32ms3516 KiB
11Accepted3/32ms3368 KiB
12Accepted3/32ms3500 KiB