/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 540.0 KiB
#2 Wrong Answer 5ms 540.0 KiB
#3 Wrong Answer 6ms 496.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((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;
        if (imran==a)
            {
               flag = 9;
            }
        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:12:45
Judged At
2024-12-09 08:12:45
Judged By
Score
10
Total Time
6ms
Peak Memory
540.0 KiB