Submission #75819612
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
map<string,int> dp;
int go(string S) {
if(dp[S]) return dp[S];
int N=S.size();
for(int i=2;i<N-2;i++)
if(""+S[i-2]+S[i-1]+S[i+1]+S[i+2]=="SCSC") return dp[S]=1;
for(int i=0;i<N;i++) if(go(S.substr(0,i)+S.substr(i+1,N-i-1))==2) return dp[S]=1;
return dp[S]=2;
}
void solve() {
string S;cin>>S;
cout<<(go(S)==1?"Terra\n":"Lulu\n");
}
int main() {
cin.tie(0)->sync_with_stdio(0);
int T;cin>>T;while(T--) solve();
}
Submission Info
| Submission Time | |
|---|---|
| Task | G - SCSC Game |
| User | strain7626 |
| Language | C++23 (GCC 15.2.0) |
| Score | 0 |
| Code Size | 546 Byte |
| Status | WA |
| Exec Time | > 2000 ms |
| Memory | > 1048576 KiB |
Compile Error
./Main.cpp: In function 'int go(std::string)':
./Main.cpp:12:42: warning: comparison with string literal results in unspecified behavior [-Waddress]
12 | if(""+S[i-2]+S[i-1]+S[i+1]+S[i+2]=="SCSC") return dp[S]=1;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Judge Result
| Set Name | Sample | All | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 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 | 4 ms | 6320 KiB |
| 01-001.txt | WA | 235 ms | 16404 KiB |
| 01-002.txt | WA | 227 ms | 16148 KiB |
| 01-003.txt | WA | 229 ms | 16080 KiB |
| 01-004.txt | WA | 228 ms | 16052 KiB |
| 01-005.txt | WA | 225 ms | 15924 KiB |
| 01-006.txt | WA | 224 ms | 15904 KiB |
| 01-007.txt | WA | 235 ms | 16180 KiB |
| 01-008.txt | WA | 225 ms | 16052 KiB |
| 01-009.txt | WA | 236 ms | 16052 KiB |
| 01-010.txt | WA | 225 ms | 15956 KiB |
| 01-011.txt | WA | 230 ms | 16228 KiB |
| 01-012.txt | WA | 225 ms | 16168 KiB |
| 01-013.txt | WA | 222 ms | 15924 KiB |
| 01-014.txt | WA | 217 ms | 15792 KiB |
| 01-015.txt | WA | 237 ms | 16468 KiB |
| 01-016.txt | WA | 3 ms | 6320 KiB |
| 01-017.txt | MLE | 1348 ms | > 1048576 KiB |
| 01-018.txt | MLE | 1334 ms | > 1048576 KiB |
| 01-019.txt | MLE | 1283 ms | > 1048576 KiB |
| 01-020.txt | MLE | 1271 ms | > 1048576 KiB |
| 01-021.txt | WA | 8 ms | 6332 KiB |
| 01-022.txt | WA | 13 ms | 6708 KiB |
| 01-023.txt | MLE | 931 ms | > 1048576 KiB |
| 01-024.txt | MLE | 934 ms | > 1048576 KiB |
| 01-025.txt | MLE | 1240 ms | > 1048576 KiB |
| 01-026.txt | MLE | 1245 ms | > 1048576 KiB |
| 01-027.txt | MLE | 1305 ms | > 1048576 KiB |
| 01-028.txt | MLE | 1326 ms | > 1048576 KiB |
| 01-029.txt | MLE | 1323 ms | > 1048576 KiB |
| 01-030.txt | MLE | 1113 ms | > 1048576 KiB |
| 01-031.txt | MLE | 1325 ms | > 1048576 KiB |
| 01-032.txt | MLE | 1323 ms | > 1048576 KiB |
| 01-033.txt | MLE | 1113 ms | > 1048576 KiB |
| 01-034.txt | MLE | 1265 ms | > 1048576 KiB |
| 01-035.txt | MLE | 1262 ms | > 1048576 KiB |
| 01-036.txt | TLE | > 2000 ms | 84380 KiB |
| 01-037.txt | WA | 10 ms | 6452 KiB |
| 01-038.txt | TLE | > 2000 ms | 83884 KiB |