/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 2ms 540.0 KiB
#3 Accepted 3ms 332.0 KiB
#4 Accepted 1ms 576.0 KiB
#5 Accepted 2ms 540.0 KiB
#6 Accepted 2ms 584.0 KiB
#7 Accepted 2ms 784.0 KiB
#8 Accepted 2ms 756.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define all(v) v.begin(),v.end()
#define nl "\n"
#define FIO \
    ios_base::sync_with_stdio(false);\
    cin.tie(NULL);\
    cout.tie(NULL);

void solve()
{
    ll n;   cin>>n;
    string s;   cin>>s;
    string ans="SeriousOJ";
    string check;
    ll j=0;
    for(ll i=0;i<n;i++)
    {
        if(s[i]==ans[j])
        {
            check.push_back(s[i]);
            j++;
        }
    }
    if(check==ans)  cout<<"YES"<<nl;
    else cout<<"NO"<<nl;
}

int32_t main()
{
 FIO
    ll t=1;
    cin>>t;
    for(ll i=1;i<=t;i++)
    {
        // cout<<"Case "<<i<<": ";
        solve();
    }
}

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 04:52:25
Judged At
2024-12-09 04:52:25
Judged By
Score
100
Total Time
3ms
Peak Memory
784.0 KiB