/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 3ms 540.0 KiB
#3 Accepted 4ms 348.0 KiB
#4 Accepted 2ms 540.0 KiB
#5 Accepted 2ms 332.0 KiB
#6 Accepted 2ms 540.0 KiB
#7 Accepted 3ms 744.0 KiB
#8 Accepted 2ms 576.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld  long double
#define ull unsigned long long
#define PI acos(-1.0)
#define vi vector<ll>
#define pii pair<ll,ll>
#define vii vector<pii>
#define rev_str(str) reverse(str.begin(),str.end());
#define print(v) for(auto i:v) cout<<i<<" ";cout<<endl;
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define rep(i,a,b) for(ll i =a ;i<b;i++)
#define per(i,b,a) for(ll i=b;i>=a;i--)
#define all(a)  (a.begin(),a.end())
#define srt(a) sort(all(a))
#define rsrt(a) sort(a.rbegin(),a.rend())
bool sortByValue(const pair<int,int>& a,const pair<int,int>& b){
    return a.second > b.second;
}
const ll N=10e5+5;

ll gcd(ll a,ll b){
    return b == 0 ? a : gcd(b, a%b);
}

ll lcm(ll a,ll b){
    return (a / gcd(a, b)) * b;
}


void solve(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    string t = "SeriousOJ";
    int j = 0;
    for (int i = 0; i < n; i++){
        if (s[i] == t[j]){
            j++;
        }
    }

    cout << (j == t.size() ? "YES" : "NO") << endl;
}

int main(){
    fast;
    ll t=1;cin>>t;
    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:52:19
Judged At
2024-12-09 04:52:19
Judged By
Score
100
Total Time
4ms
Peak Memory
744.0 KiB