Submission #1813615
Source Code Expand
#include <cstdio> int n, a[100005]; char s[100005]; int main() { int i, j; freopen("input.txt", "r", stdin); scanf("%d%s", &n, s); s[n]=s[0]; for(i=0; i<4; i++) { a[0] = i%2, a[1] = i/2%2; for(j=2; j<n+2; j++) a[j] = a[j-1] ^ a[j-2] ^ s[j-1]=='x'; if(a[0]==a[n] && a[1]==a[n+1]) { for(j=0; j<n; j++) putchar(a[j] ? 'W':'S'); return 0; } } puts("-1"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Menagerie |
User | t1234 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 402 Byte |
Status | WA |
Exec Time | 0 ms |
Memory | 128 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:6:34: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] freopen("input.txt", "r", stdin); ^ ./Main.cpp:7:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d%s", &n, s); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt |
All | 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | WA | 0 ms | 128 KB |
00_example_02.txt | WA | 0 ms | 128 KB |
00_example_03.txt | WA | 0 ms | 128 KB |
01.txt | WA | 0 ms | 128 KB |
02.txt | WA | 0 ms | 128 KB |
03.txt | WA | 0 ms | 128 KB |
04.txt | WA | 0 ms | 128 KB |
05.txt | WA | 0 ms | 128 KB |
06.txt | WA | 0 ms | 128 KB |
07.txt | WA | 0 ms | 128 KB |
08.txt | WA | 0 ms | 128 KB |
09.txt | WA | 0 ms | 128 KB |
10.txt | WA | 0 ms | 128 KB |
11.txt | WA | 0 ms | 128 KB |
12.txt | WA | 0 ms | 128 KB |
13.txt | WA | 0 ms | 128 KB |