Accepted
Code
#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
#ifdef LOCAL
#include "debug.hpp"
#else
#define debug(...) 42
#endif
const string t = "SeriousOJ";
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll T;
cin >> T;
while (T--) {
ll n;
cin >> n;
string s;
cin >> s;
ll i = 0, j = 0;
while (i < n && j < t.length()) {
if (s[i] == t[j]) {
i++, j++;
} else {
i++;
}
}
cout << (j == t.length() ? "YES\n" : "NO\n");
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1147 SeriousOJ Challenge
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-12-12 11:57:16
- Judged At
- 2024-12-12 11:57:16
- Judged By
- Score
- 100
- Total Time
- 2ms
- Peak Memory
- 772.0 KiB