Ghost leg solver

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Solve Ghost Leg (known in Japan as Amidakuji).

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

A B C D E
| | |-| |
|-| | |-|
| |-| |-|
|-| |-| |
|-| | | |

Sample output:

A B C D E
| | |-| |
|-| | |-|
| |-| |-|
|-| |-| |
|-| | | |
B D C A E

Sample input:_

A B C D E
| |-| |-|
|-| |-| |
| |-| |-|
|-| |-| |
| |-| |-|

Sample output:

A B C D E
| |-| |-|
|-| |-| |
| |-| |-|
|-| |-| |
| |-| |-|
E D C B A

Sample input:_

A B C D E
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |

Sample output:

A B C D E
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
A B C D E

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1murky-satyr500.00162010/04/19 14:00:210B / 19B / 22B
2gnibbler570.00152010/04/12 14:45:040B / 29B / 15B

Perl _

RankUserSizeTimeDateStatistics
1yibe470.00162010/04/20 00:26:150B / 22B / 24B
2nai470.00152010/04/20 00:35:200B / 22B / 24B
3dcutter600.00142010/04/14 00:10:280B / 18B / 34B

Python _

RankUserSizeTimeDateStatistics
1primo (luck)730.00842010/04/19 21:03:120B / 46B / 24B
2hallvabo790.05282010/04/08 01:49:070B / 50B / 24B
3gnibbler860.01152010/04/12 12:41:330B / 50B / 31B

PHP _

RankUserSizeTimeDateStatistics
1teebee(o-cn)740.08112011/03/10 12:32:3530B / 23B / 21B
2o-cn770.01712010/04/24 15:06:090B / 38B / 24B

Io _

RankUserSizeTimeDateStatistics
1pooq1000.21812012/11/23 23:45:300B / 64B / 20B

JavaScript _

RankUserSizeTimeDateStatistics
1murky-satyr800.00292010/04/19 13:51:140B / 35B / 36B
2xulapp810.00372010/04/20 04:21:210B / 43B / 29B

BASIC _

RankUserSizeTimeDateStatistics
1*yuko*931.79312010/04/13 09:49:520B / 52B / 27B

Erlang _

RankUserSizeTimeDateStatistics
1eriksoe2430.38052010/04/13 01:39:347B / 99B / 128B

J _

RankUserSizeTimeDateStatistics
1pooq550.05242010/04/18 17:07:140B / 20B / 26B
2I., S.400.09362011/11/26 07:34:340B / 11B / 28B
3pooq490.05882010/04/20 11:44:060B / 30B / 16B

C _

RankUserSizeTimeDateStatistics
1inaniwa(embed)770.03612010/04/09 08:18:382B / 40B / 23B
2not1060.00092010/04/12 08:18:260B / 53B / 53B
3inaniwa1110.00092010/04/15 17:29:450B / 55B / 56B
4not920.00102010/04/21 23:41:120B / 39B / 53B

OCaml _

RankUserSizeTimeDateStatistics
1m.ukai (embed)1080.10792010/09/06 14:07:160B / 54B / 40B

Haskell _

RankUserSizeTimeDateStatistics
1notogawa(embed)840.12992010/04/07 17:45:060B / 40B / 31B
2rst76(embed)840.06802010/04/08 20:02:340B / 44B / 31B
3Lost_dog(embed)930.00152010/04/17 21:18:180B / 45B / 34B
4tanakh960.03712010/04/06 15:39:580B / 36B / 44B
5rst761010.02922010/04/07 01:06:550B / 45B / 52B
6Lost_dog1090.00152010/04/17 23:48:060B / 64B / 39B
7nobsun1280.04682010/04/06 13:01:461B / 57B / 59B

Java _

RankUserSizeTimeDateStatistics
1hallvabo1650.45142010/04/08 17:32:370B / 103B / 48B
2mulder_fbi1780.35852010/04/10 06:07:410B / 110B / 54B

Pascal _

RankUserSizeTimeDateStatistics
1*yuko*1310.01272010/04/13 09:21:410B / 87B / 28B
2*yuko*1160.01292010/04/20 07:24:030B / 79B / 21B

Fortran _

RankUserSizeTimeDateStatistics
1*yuko*1180.00142010/04/13 10:05:280B / 70B / 34B
2*yuko*1050.02092012/11/19 21:33:080B / 61B / 29B

AWK _

RankUserSizeTimeDateStatistics
1nn660.00122010/04/18 16:00:390B / 31B / 23B

wake _

RankUserSizeTimeDateStatistics
1emoken1500.01362010/07/27 07:05:300B / 27B / 115B

Postscript _

RankUserSizeTimeDateStatistics
1yshl(embed)(bin)700.23912010/04/25 12:26:5417B / 34B / 4B
2yshl(embed)970.24412010/04/25 12:22:550B / 63B / 13B

R _

RankUserSizeTimeDateStatistics
1pooq820.89952011/08/21 18:57:440B / 44B / 25B

GolfScript _

RankUserSizeTimeDateStatistics
1gnibbler300.11222010/04/07 21:03:210B / 22B / 7B

Vim _

RankUserSizeTimeDateStatistics
1pla390.08912010/04/13 23:00:060B / 24B / 11B
2clock340.16102011/12/21 23:36:502B / 18B / 12B

goruby _

RankUserSizeTimeDateStatistics
1murky-satyr390.08522010/04/19 14:01:420B / 15B / 15B

Groovy _

RankUserSizeTimeDateStatistics
1nn773.37702010/04/18 16:12:450B / 33B / 36B

Language Ranking_

RankLangUserSizeScore
1GolfScriptgnibbler3010000
2Vimclock348823
3gorubymurky-satyr397692
4JI., S.407500
5Perlyibe476382
6Rubymurky-satyr506000
7AWKnn664545
8Postscriptyshl(embed)(bin)704285
9Pythonprimo (luck)734109
10PHPteebee(o-cn)744054
11Cinaniwa(embed)773896
12Groovynn773896
13JavaScriptmurky-satyr803750
14Rpooq823658
15Haskellnotogawa(embed)843571
16BASIC*yuko*933225
17Iopooq1003000
18Fortran*yuko*1052857
19OCamlm.ukai (embed)1082777
20Pascal*yuko*1162586
21wakeemoken1502000
22Javahallvabo1651818
23Erlangeriksoe2431234

return top