/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 4ms 540.0 KiB
#3 Accepted 5ms 480.0 KiB
#4 Accepted 6ms 516.0 KiB
#5 Accepted 6ms 540.0 KiB
#6 Accepted 5ms 332.0 KiB
#7 Accepted 5ms 604.0 KiB
#8 Accepted 6ms 584.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:58:54
Judged At
2024-12-09 04:58:54
Judged By
Score
100
Total Time
6ms
Peak Memory
604.0 KiB