/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 5ms 540.0 KiB
#3 Accepted 5ms 332.0 KiB
#4 Accepted 3ms 332.0 KiB
#5 Accepted 5ms 500.0 KiB
#6 Accepted 3ms 336.0 KiB
#7 Accepted 5ms 752.0 KiB
#8 Accepted 4ms 696.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
	int n; cin>>n;
	string s;
    cin>>s;
    string ans = "SeriousOJ";
    int m = ans.size();
    int i=0, j=0;
    while(i<n && j<m)
    {
    	if(s[i]==ans[j])
    	{
    		i++;
    		j++;
    	}
    	else i++;
    }
    if(j==m)
    	cout<<"YES\n";
    else cout<<"NO\n";


}
int32_t main()
{
    int t; 
    cin>>t;
    // t=1;
    while(t--)
    {
    	solve();
    }
	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 04:56:22
Judged At
2024-12-09 04:56:22
Judged By
Score
100
Total Time
5ms
Peak Memory
752.0 KiB