/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 2ms 540.0 KiB
#3 Accepted 2ms 772.0 KiB
#4 Accepted 2ms 540.0 KiB
#5 Accepted 2ms 560.0 KiB
#6 Accepted 2ms 772.0 KiB
#7 Accepted 2ms 812.0 KiB
#8 Accepted 2ms 604.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define bug(a) cout<< #a << " : " << a << endl;
#define bug2(a, b) cout << #a << " : " << a << "   " << #b << " : " << b << endl;

string f = "SeriousOJ";

void solve(int cs){
    int n;
    string s;
    cin >> n >> s;
    int idx = 0;
    for(auto u : s){
        if(u == f[idx]) idx++;
        if(idx == f.size()) break;
    }
    if(idx == f.size()) cout << "YES\n";
    else cout << "NO\n";
}

int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);
    cout.tie(0);

    int tc = 1;
    cin >> tc;

    for(int cs = 1; cs <= tc; cs++){
        solve(cs);
    }
} 

Information

Submit By
Type
Submission
Problem
P1147 SeriousOJ Challenge
Contest
LU IUJPC : Sylhet Division 2024 Replay Contest
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-10 09:14:22
Judged At
2024-12-10 09:14:22
Judged By
Score
100
Total Time
2ms
Peak Memory
812.0 KiB