Submission #1123259
Source Code Expand
#!/usr/bin/ruby n=gets.to_i s=gets.chomp [83,87].repeated_permutation(2).find{|_| a=_.dup 2.upto(n+1){|i| a[i]=a[i-2]^((a[i-1]==87)^(s[~-i%n]==?x) ? 4 : 0) } $><<a[0..-3].map(&:chr)*''if a[0]==a[n]&&a[1]==a[n+1] }||(p -1)
Submission Info
Submission Time | |
---|---|
Task | D - Menagerie |
User | leafmoon |
Language | Ruby (2.3.3) |
Score | 500 |
Code Size | 236 Byte |
Status | AC |
Exec Time | 288 ms |
Memory | 8028 KB |
Compile Error
./Main.rb:10: warning: ambiguous first argument; put parentheses or a space even after `-' operator
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 | 7 ms | 1788 KB |
00_example_02.txt | AC | 7 ms | 1788 KB |
00_example_03.txt | AC | 7 ms | 1788 KB |
01.txt | AC | 131 ms | 5780 KB |
02.txt | AC | 43 ms | 4476 KB |
03.txt | AC | 12 ms | 1788 KB |
04.txt | AC | 7 ms | 1788 KB |
05.txt | AC | 192 ms | 7540 KB |
06.txt | AC | 85 ms | 7420 KB |
07.txt | AC | 35 ms | 2656 KB |
08.txt | AC | 29 ms | 2684 KB |
09.txt | AC | 11 ms | 1916 KB |
10.txt | AC | 46 ms | 2300 KB |
11.txt | AC | 288 ms | 8028 KB |
12.txt | AC | 278 ms | 8028 KB |
13.txt | AC | 216 ms | 8028 KB |