/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 2ms 344.0 KiB
#3 Accepted 2ms 772.0 KiB
#4 Accepted 2ms 332.0 KiB
#5 Accepted 2ms 772.0 KiB
#6 Accepted 3ms 560.0 KiB
#7 Accepted 2ms 772.0 KiB
#8 Accepted 2ms 748.0 KiB

Code

/**
 *    author:   Binoy Barman
 *    created:  2024-12-10 15:06:51
**/

#include<bits/stdc++.h>
using namespace std;
#define nl '\n'
#define all(v) v.begin(), v.end()
#define Too_Many_Jobs int tts, tc = 1; cin >> tts; hell: while(tts--)
#define Dark_Lord_Binoy ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifdef LOCAL
#include "debug/whereisit.hpp"
#else
#define dbg(...) 42
#endif
#define int long long

int32_t main() {
Dark_Lord_Binoy
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    string t = "SeriousOJ";
    Too_Many_Jobs {
        int n;
        string s;
        cin >> n >> s;
        int j = 0, m = t.size();
        for (int i = 0; i < n; i++) {
            if(j < m && s[i] == t[j]) j++;
        }
        cout << (j == m ? "YES" : "NO") << nl;
    }
    
    return 0;
}

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:12:08
Judged At
2024-12-10 09:12:08
Judged By
Score
100
Total Time
3ms
Peak Memory
772.0 KiB