Submission #75822088
Source Code Expand
#include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end())
#define sz(x) (int)(x).size()
using namespace std;
typedef long long ll;
int main() {
fastio; int T; cin >> T;
for (int tc = 0; tc < T; tc++) {
string S; cin >> S;
bool win = false;
for (int i = 0; i < sz(S); i++) {
bool b = false;
for (int j = i-3; j <= i-1; j++) {
if (j < 0 || j+4 >= sz(S)) continue;
string s = "SCSC"; int c = 0;
bool chk = true;
for (int k = j; k < j+5; k++) {
if (k == i) continue;
if (S[k] != s[c++]) {
chk = false; break;
}
}
if (chk) {
b = true; break;
}
}
if (b) {
win = true; break;
}
}
if (win) cout << "Terra\n";
else cout << (sz(S)%2 ? "Terra" : "Lulu") << "\n";
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | G - SCSC Game |
| User | Lov34ever |
| Language | C++23 (GCC 15.2.0) |
| Score | 100 |
| Code Size | 1217 Byte |
| Status | AC |
| Exec Time | 4 ms |
| Memory | 3804 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-001.txt |
| All | 00-sample-001.txt, 01-001.txt, 01-002.txt, 01-003.txt, 01-004.txt, 01-005.txt, 01-006.txt, 01-007.txt, 01-008.txt, 01-009.txt, 01-010.txt, 01-011.txt, 01-012.txt, 01-013.txt, 01-014.txt, 01-015.txt, 01-016.txt, 01-017.txt, 01-018.txt, 01-019.txt, 01-020.txt, 01-021.txt, 01-022.txt, 01-023.txt, 01-024.txt, 01-025.txt, 01-026.txt, 01-027.txt, 01-028.txt, 01-029.txt, 01-030.txt, 01-031.txt, 01-032.txt, 01-033.txt, 01-034.txt, 01-035.txt, 01-036.txt, 01-037.txt, 01-038.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-001.txt | AC | 1 ms | 3548 KiB |
| 01-001.txt | AC | 2 ms | 3560 KiB |
| 01-002.txt | AC | 2 ms | 3556 KiB |
| 01-003.txt | AC | 2 ms | 3428 KiB |
| 01-004.txt | AC | 2 ms | 3556 KiB |
| 01-005.txt | AC | 2 ms | 3556 KiB |
| 01-006.txt | AC | 2 ms | 3492 KiB |
| 01-007.txt | AC | 2 ms | 3492 KiB |
| 01-008.txt | AC | 2 ms | 3492 KiB |
| 01-009.txt | AC | 2 ms | 3516 KiB |
| 01-010.txt | AC | 2 ms | 3560 KiB |
| 01-011.txt | AC | 2 ms | 3560 KiB |
| 01-012.txt | AC | 2 ms | 3496 KiB |
| 01-013.txt | AC | 2 ms | 3428 KiB |
| 01-014.txt | AC | 2 ms | 3548 KiB |
| 01-015.txt | AC | 2 ms | 3556 KiB |
| 01-016.txt | AC | 1 ms | 3556 KiB |
| 01-017.txt | AC | 3 ms | 3668 KiB |
| 01-018.txt | AC | 2 ms | 3748 KiB |
| 01-019.txt | AC | 3 ms | 3788 KiB |
| 01-020.txt | AC | 3 ms | 3664 KiB |
| 01-021.txt | AC | 1 ms | 3492 KiB |
| 01-022.txt | AC | 1 ms | 3428 KiB |
| 01-023.txt | AC | 3 ms | 3724 KiB |
| 01-024.txt | AC | 3 ms | 3664 KiB |
| 01-025.txt | AC | 1 ms | 3756 KiB |
| 01-026.txt | AC | 1 ms | 3724 KiB |
| 01-027.txt | AC | 1 ms | 3732 KiB |
| 01-028.txt | AC | 1 ms | 3664 KiB |
| 01-029.txt | AC | 2 ms | 3788 KiB |
| 01-030.txt | AC | 1 ms | 3668 KiB |
| 01-031.txt | AC | 1 ms | 3800 KiB |
| 01-032.txt | AC | 2 ms | 3804 KiB |
| 01-033.txt | AC | 1 ms | 3732 KiB |
| 01-034.txt | AC | 3 ms | 3792 KiB |
| 01-035.txt | AC | 3 ms | 3728 KiB |
| 01-036.txt | AC | 4 ms | 3556 KiB |
| 01-037.txt | AC | 2 ms | 3568 KiB |
| 01-038.txt | AC | 2 ms | 3560 KiB |