/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 5ms 540.0 KiB
#3 Accepted 6ms 332.0 KiB
#4 Accepted 4ms 332.0 KiB
#5 Accepted 5ms 516.0 KiB
#6 Accepted 4ms 764.0 KiB
#7 Accepted 4ms 540.0 KiB
#8 Accepted 5ms 660.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
int main()
{
    ll tc;
    cin>>tc;
    while(tc--)
    {
        ll n;
        cin>>n;
        string s;
        cin>>s;
        string k;
        k="SeriousOJ";
        ll c=0;
        for(int i=0;i<s.size();i++)
        {
            if(c<k.size() && s[i]==k[c])
                c++;
        }
        if(c==k.size())
            cout<<"YES\n";
        else
            cout<<"NO\n";

    }
}

Information

Submit By
Type
Submission
Problem
P1147 SeriousOJ Challenge
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-11 14:27:09
Judged At
2024-12-11 14:27:09
Judged By
Score
100
Total Time
6ms
Peak Memory
764.0 KiB