Accepted
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