Accepted
Code
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define bug(a) cout << #a << " : " << a << '\n';
void solve(int cs){
string s = "SeriousOJ";
int n;cin >> n;
int ind = 0;bool ok = false;
for (int i = 0; i < n; ++i)
{
char c;cin >> c;
if(c == s[ind]) ind++;
if(ind == s.size()) ok = true;
}
if(ok)cout << "YES\n";
else cout << "NO" << endl;
}
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int t; cin>>t;
int cs = 0;
while(t--){
solve(++cs);
}
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 05:00:00
- Judged At
- 2024-12-09 05:00:00
- Judged By
- Score
- 100
- Total Time
- 5ms
- Peak Memory
- 768.0 KiB