/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 332.0 KiB
#2 Wrong Answer 6ms 356.0 KiB
#3 Wrong Answer 9ms 512.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 == "Serious") && s[i]=='O'){
                a=a+s[i];
                } else if((a == "SeriousO") && s[i]=='J'){
                a=a+s[i];
                } else if((a == "Seriou") && s[i]=='s'){
                a=a+s[i];
                }else if((a == "Serio") && s[i]=='u'){
                a=a+s[i];
                }else if((a == "Seri") && s[i]=='o'){
                a=a+s[i];
                }else if((a == "Ser") && s[i]=='i'){
                a=a+s[i];
                }else if((a == "Se") && s[i]=='r'){
                a=a+s[i];
                }else if((a == "S") && s[i]=='e'){
                a=a+s[i];
                } else if((a == "") && s[i]=='S'){
                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 08:05:27
Judged At
2024-12-09 08:05:27
Judged By
Score
10
Total Time
9ms
Peak Memory
512.0 KiB