/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 6ms 540.0 KiB
#3 Wrong Answer 6ms 540.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    string imran="SeriousOJ";
    while(t--)
    {
       int N;
       cin>>N;
       char c;
       cin>>c;
       string s;
        getline(cin,s);
        s=s+c;
        string a;
        for (int i=0; i<N; i++)
        {
            if (s[i]=='S' || s[i]=='e' || s[i]=='r' || s[i]=='i' || s[i]=='o' || s[i]=='u' || s[i]=='s' || s[i]=='O' || s[i]=='J')
            {
                if(a.size() >= 7 && (s[i]=='O' || s[i]=='J')){
                a=a+s[i];
                }
                if(a.size() < 8){
                a=a+s[i];
                }

            }
        }
        //unique(a.begin(),a.end());
        int b=unique(a.begin(),a.end())-a.begin();
        // for (int j=0; j<b; j++)
        // {
        //     cout << a[j];
        // }
        int flag=0;
        for(int k=0; k<b; k++)
        {
            if (imran[k]==a[k])
            {
                flag++;
            }
        }
        if (flag==9)
        {
            cout<<"YES"<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }

    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1147 SeriousOJ Challenge
Contest
LU IUJPC : Sylhet Division 2024
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-09 07:57:40
Judged At
2024-12-09 07:57:40
Judged By
Score
10
Total Time
6ms
Peak Memory
540.0 KiB