Submission #75819236
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define MOD 1000000007
#define INF 987654321
#define PI 3.1415926535
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
{
string s;
cin >> s;
int n = s.length();
if (n % 2 == 1)
{
cout << "Terra\n";
continue;
}
vector<int> v;
int cur = 1;
for (int i = 1; i < n; i++)
{
if (s[i] == s[i - 1])
{
cur++;
}
else
{
v.push_back(cur);
cur = 1;
}
}
v.push_back(cur);
int l = 1, r = v.size() - 1;
if (s[0] == 'C')
{
l = 2;
}
if (s[n - 1] == 'S')
{
r = v.size() - 2;
}
if (l >= r)
{
cout << "Lulu\n";
continue;
}
bool terra = false;
for (int i = l; i + 1 < r; i += 2)
{
if ((v[i] == 1 && v[i + 1] == 2) || (v[i] == 2 && v[i + 1] == 1))
{
terra = true;
break;
}
}
if (terra)
{
cout << "Terra\n";
}
else
{
cout << "Lulu\n";
}
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | G - SCSC Game |
| User | Nyso |
| Language | C++23 (GCC 15.2.0) |
| Score | 100 |
| Code Size | 1505 Byte |
| Status | AC |
| Exec Time | 3 ms |
| Memory | 4212 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 | 3524 KiB |
| 01-001.txt | AC | 2 ms | 3468 KiB |
| 01-002.txt | AC | 2 ms | 3464 KiB |
| 01-003.txt | AC | 2 ms | 3504 KiB |
| 01-004.txt | AC | 2 ms | 3520 KiB |
| 01-005.txt | AC | 2 ms | 3520 KiB |
| 01-006.txt | AC | 2 ms | 3592 KiB |
| 01-007.txt | AC | 2 ms | 3452 KiB |
| 01-008.txt | AC | 2 ms | 3520 KiB |
| 01-009.txt | AC | 2 ms | 3524 KiB |
| 01-010.txt | AC | 2 ms | 3464 KiB |
| 01-011.txt | AC | 2 ms | 3524 KiB |
| 01-012.txt | AC | 2 ms | 3520 KiB |
| 01-013.txt | AC | 2 ms | 3464 KiB |
| 01-014.txt | AC | 2 ms | 3560 KiB |
| 01-015.txt | AC | 2 ms | 3592 KiB |
| 01-016.txt | AC | 1 ms | 3520 KiB |
| 01-017.txt | AC | 1 ms | 3892 KiB |
| 01-018.txt | AC | 1 ms | 3860 KiB |
| 01-019.txt | AC | 1 ms | 4152 KiB |
| 01-020.txt | AC | 1 ms | 4140 KiB |
| 01-021.txt | AC | 1 ms | 3524 KiB |
| 01-022.txt | AC | 1 ms | 3524 KiB |
| 01-023.txt | AC | 2 ms | 4156 KiB |
| 01-024.txt | AC | 1 ms | 3756 KiB |
| 01-025.txt | AC | 1 ms | 4204 KiB |
| 01-026.txt | AC | 1 ms | 4212 KiB |
| 01-027.txt | AC | 1 ms | 4080 KiB |
| 01-028.txt | AC | 1 ms | 3756 KiB |
| 01-029.txt | AC | 1 ms | 3824 KiB |
| 01-030.txt | AC | 1 ms | 3772 KiB |
| 01-031.txt | AC | 1 ms | 3704 KiB |
| 01-032.txt | AC | 1 ms | 3808 KiB |
| 01-033.txt | AC | 1 ms | 3772 KiB |
| 01-034.txt | AC | 1 ms | 4156 KiB |
| 01-035.txt | AC | 1 ms | 4160 KiB |
| 01-036.txt | AC | 3 ms | 3552 KiB |
| 01-037.txt | AC | 2 ms | 3464 KiB |
| 01-038.txt | AC | 1 ms | 3704 KiB |