Submission #3225380
Source Code Expand
N = int(input()) s = input() s = s[1:] + s[0] ans = [] for i, j in [('S', 'S'), ('S', 'W'), ('W', 'S'), ('W', 'W')]: ans = [i, j] for si in s: if ans[-1] == 'S': if si == 'o': ans.append(ans[-2]) else: ans.append('W' if ans[-2] == 'S' else 'S') else: if si == 'o': ans.append('W' if ans[-2] == 'S' else 'S') else: ans.append(ans[-2]) if ans[:2] == ans[-2:]: print(''.join(ans[:-2])) break else: print(-1)
Submission Info
Submission Time | |
---|---|
Task | D - Menagerie |
User | poina |
Language | Python (3.4.3) |
Score | 500 |
Code Size | 585 Byte |
Status | AC |
Exec Time | 114 ms |
Memory | 4868 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 500 / 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 | AC | 17 ms | 3064 KB |
00_example_02.txt | AC | 17 ms | 3064 KB |
00_example_03.txt | AC | 17 ms | 3064 KB |
01.txt | AC | 61 ms | 4224 KB |
02.txt | AC | 29 ms | 3956 KB |
03.txt | AC | 20 ms | 3064 KB |
04.txt | AC | 17 ms | 3064 KB |
05.txt | AC | 81 ms | 4684 KB |
06.txt | AC | 40 ms | 4780 KB |
07.txt | AC | 28 ms | 3316 KB |
08.txt | AC | 25 ms | 3312 KB |
09.txt | AC | 19 ms | 3064 KB |
10.txt | AC | 35 ms | 3292 KB |
11.txt | AC | 112 ms | 4868 KB |
12.txt | AC | 114 ms | 4868 KB |
13.txt | AC | 88 ms | 4868 KB |