Runtime Error
Code
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define nl "\n"
int main() {
ll t=1;
cin>>t;
while(t--)
{
ll n;
cin>>n;
string s;
cin>>s;
string x = "SeriousOJ";
reverse(s.begin(),s.end());
reverse(x.begin(),x.end());
for(ll i=0;i<n;i++)
{
if(x.empty())
{
break;
}
if(x[0]==s[i])
{
if(!x.empty())
{
x.erase(i);
}
}
}
if(x.empty())
{
cout<<"YES"<<nl;
}
else
{
cout<<"NO"<<nl;
}
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1147 SeriousOJ Challenge
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-12-13 09:46:36
- Judged At
- 2024-12-13 09:46:36
- Judged By
- Score
- 10
- Total Time
- 2ms
- Peak Memory
- 796.0 KiB