Submission #75817354
Source Code Expand
import sys
input = lambda: sys.stdin.readline().rstrip()
def solve():
S = input()
n = len(S)
for i in range(n):
if i - 1 >= 0 and i + 3 < n and (S[i - 1] + S[i + 1 : i + 4]) == "SCSC":
print("Terra")
return
if i - 2 >= 0 and i + 2 < n and (S[i - 2 : i] + S[i + 1 : i + 3]) == "SCSC":
print("Terra")
return
if i - 3 >= 0 and i + 1 < n and (S[i - 3 : i] + S[i + 1]) == "SCSC":
print("Terra")
return
if n % 2 == 1:
print("Terra")
else:
print("Lulu")
def main():
T = int(input())
for _ in range(T):
solve()
main()
Submission Info
| Submission Time | |
|---|---|
| Task | G - SCSC Game |
| User | skuru |
| Language | Python (PyPy 3.11-v7.3.20) |
| Score | 100 |
| Code Size | 700 Byte |
| Status | AC |
| Exec Time | 94 ms |
| Memory | 108756 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 | 47 ms | 79384 KiB |
| 01-001.txt | AC | 94 ms | 108580 KiB |
| 01-002.txt | AC | 91 ms | 108424 KiB |
| 01-003.txt | AC | 90 ms | 108456 KiB |
| 01-004.txt | AC | 87 ms | 108404 KiB |
| 01-005.txt | AC | 90 ms | 108552 KiB |
| 01-006.txt | AC | 81 ms | 108428 KiB |
| 01-007.txt | AC | 87 ms | 108396 KiB |
| 01-008.txt | AC | 90 ms | 108672 KiB |
| 01-009.txt | AC | 89 ms | 108636 KiB |
| 01-010.txt | AC | 86 ms | 108468 KiB |
| 01-011.txt | AC | 90 ms | 108400 KiB |
| 01-012.txt | AC | 80 ms | 108404 KiB |
| 01-013.txt | AC | 81 ms | 108344 KiB |
| 01-014.txt | AC | 94 ms | 108756 KiB |
| 01-015.txt | AC | 89 ms | 108400 KiB |
| 01-016.txt | AC | 46 ms | 79400 KiB |
| 01-017.txt | AC | 62 ms | 107232 KiB |
| 01-018.txt | AC | 62 ms | 107196 KiB |
| 01-019.txt | AC | 62 ms | 107608 KiB |
| 01-020.txt | AC | 62 ms | 107596 KiB |
| 01-021.txt | AC | 46 ms | 79564 KiB |
| 01-022.txt | AC | 75 ms | 108508 KiB |
| 01-023.txt | AC | 63 ms | 107604 KiB |
| 01-024.txt | AC | 63 ms | 107568 KiB |
| 01-025.txt | AC | 47 ms | 80856 KiB |
| 01-026.txt | AC | 46 ms | 80500 KiB |
| 01-027.txt | AC | 46 ms | 80728 KiB |
| 01-028.txt | AC | 45 ms | 80880 KiB |
| 01-029.txt | AC | 61 ms | 107532 KiB |
| 01-030.txt | AC | 55 ms | 97624 KiB |
| 01-031.txt | AC | 46 ms | 80764 KiB |
| 01-032.txt | AC | 63 ms | 107204 KiB |
| 01-033.txt | AC | 56 ms | 97512 KiB |
| 01-034.txt | AC | 62 ms | 107536 KiB |
| 01-035.txt | AC | 62 ms | 107264 KiB |
| 01-036.txt | AC | 87 ms | 108404 KiB |
| 01-037.txt | AC | 83 ms | 108624 KiB |
| 01-038.txt | AC | 78 ms | 108216 KiB |