Sign of permutations

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

print 1 if the permutation is even.
print -1 if the permutation is odd.

Options

exec is denied

rejudge feature is enabled

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

Sample input:_

3 1 2
3 2 1
1 3 2
2 1 3
2 1 3
1 2 3
2 1 3
1 2 3
1 2 3
1 3 2
2 1 3
1 3 2
3 2 1
3 1 2
3 2 1
1 2 3
3 1 2
1 2 3
1 2 3
1 3 2
3 2 1
1 2 3
2 3 1
3 2 1
3 1 2
3 1 2
1 3 2
2 1 3
3 1 2
1 2 3
2 3 1
2 1 3
1 3 2
3 2 1
3 1 2
3 2 1
3 2 1
1 2 3
1 2 3
3 2 1
2 3 1
3 2 1
3 2 1
1 3 2
3 2 1
3 2 1
2 1 3
2 1 3
2 1 3
2 1 3
1 2 3
2 1 3
3 2 1
3 2 1
1 2 3
2 1 3
1 3 2
1 2 3
1 2 3
3 2 1
1 2 3
3 1 2
3 1 2
1 2 3
2 3 1
3 1 2
2 3 1
3 2 1
1 2 3
3 2 1
3 1 2
3 1 2
3 2 1
3 2 1
1 2 3
1 2 3
2 3 1
3 1 2
2 1 3
1 2 3
2 3 1
2 3 1
2 3 1
1 3 2
3 2 1
2 3 1
1 3 2
2 3 1
2 3 1
2 1 3
2 3 1
2 3 1
3 2 1
3 1 2
1 3 2
3 2 1
1 2 3
1 3 2
1 2 3
2 3 1

Sample output:

1
-1
-1
-1
-1
1
-1
1
1
-1
-1
-1
-1
1
-1
1
1
1
1
-1
-1
1
1
-1
1
1
-1
-1
1
1
1
-1
-1
-1
1
-1
-1
1
1
-1
1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
1
1
-1
1
1
1
1
1
1
1
-1
1
-1
1
1
-1
-1
1
1
1
1
-1
1
1
1
1
-1
-1
1
-1
1
1
-1
1
1
-1
1
-1
-1
1
-1
1
1

Sample input:_

1 5 4 3 2
2 1 4 3 5
2 1 3 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3 9
5 1 10 8 2 4 9 3 6 7
4 7 10 3 5 9 1 6 8 2
2 6 8 5 7 1 9 3 4 10
2 5 8 3 9 4 6 10 1 7
10 9 1 2 6 8 7 3 4 5
4 10 9 3 5 8 7 2 1 6
7 3 9 10 6 4 1 2 5 8
7 3 10 6 5 1 2 4 8 9

Sample output:

1
1
1
-1
1
1
-1
-1
1
1
1
-1
1
1
-1
1
-1
-1
1
-1
-1
-1
1
-1
-1
1
-1
-1
1
1
1
1
-1
1
1
-1
-1
-1
-1
-1
-1
-1
-1
1
1
-1
-1
1
-1
-1
1
-1
1
1
1
-1
1
-1
1
1
-1
-1
1
-1
-1
1
-1
1
1
-1
1
1
-1
-1
1
1
-1
-1
-1
-1
1
-1
-1
1
-1
1
1
-1
1
-1
-1
-1
1
-1
1
1
-1
1
1
1

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1Histocrat470.05402020/04/28 00:20:530B / 27B / 18B
2olf490.05532020/04/23 13:52:080B / 30B / 17B
3mitchs490.06682020/04/23 18:33:270B / 30B / 17B
4rotary-o490.05712020/04/26 13:12:150B / 30B / 17B
5Histocrat (not sure if 47 survives rejudge)490.06612020/04/28 00:24:120B / 30B / 17B

Ruby2 _

RankUserSizeTimeDateStatistics
1mitchs490.21492020/04/24 06:43:360B / 30B / 17B
2rotary-o490.19802020/04/26 13:12:010B / 30B / 17B
3Histocrat490.19332020/04/28 00:22:250B / 30B / 17B
4ludo490.19732020/04/28 23:37:410B / 30B / 17B

Perl _

RankUserSizeTimeDateStatistics
1tails400.08612020/04/27 10:42:220B / 9B / 27B

Python _

RankUserSizeTimeDateStatistics
1xnor810.09142020/04/23 12:31:460B / 45B / 26B
2mitchs820.09242020/04/23 19:38:110B / 51B / 24B
3hallvabo840.09122020/04/23 18:26:490B / 52B / 24B
4McBusLuck840.09322020/04/26 21:12:560B / 52B / 24B
5hallvabo (alt)850.16122020/04/28 22:28:120B / 50B / 32B
6Dingledooper920.09212020/04/23 07:07:110B / 60B / 28B
7rolf940.09252020/04/23 06:28:350B / 60B / 24B
8olf990.09232020/04/23 18:08:390B / 60B / 29B
9Dingledooper830.09272020/05/20 14:16:380B / 54B / 25B

Python3 _

RankUserSizeTimeDateStatistics
1mitchs790.17222020/04/24 06:44:040B / 49B / 23B

C _

RankUserSizeTimeDateStatistics
1tails850.04112020/04/22 16:08:510B / 38B / 47B
2chocobi1070.04152020/04/25 17:40:110B / 47B / 60B
3sadakiyo2240.04202020/04/28 03:24:310B / 104B / 120B
4rolf2390.04142020/04/23 02:39:000B / 128B / 105B
5nu (tails)840.04362020/04/29 10:35:270B / 41B / 43B

Octave _

RankUserSizeTimeDateStatistics
1Hendrik670.51142020/04/26 04:50:260B / 43B / 23B

AWK _

RankUserSizeTimeDateStatistics
1mitchs420.04462020/04/24 05:30:410B / 17B / 25B
2olf490.04762020/04/24 00:55:130B / 21B / 28B
3mitchs (alt)490.04722020/04/29 07:27:470B / 20B / 29B

sed _

RankUserSizeTimeDateStatistics
1tails680.04432020/04/24 09:36:350B / 30B / 31B
2mitchs690.04612020/04/25 00:21:200B / 26B / 36B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails680.10992020/04/22 16:32:350B / 27B / 31B
2McBusLuck850.79022020/04/24 03:15:320B / 35B / 39B
3tails (xnor.py)670.35032020/04/29 00:10:460B / 25B / 31B

bc _

RankUserSizeTimeDateStatistics
1ludo980.04742020/04/28 23:30:070B / 44B / 53B
2olf1080.05102020/04/24 23:02:280B / 51B / 54B
3McBusLuck1270.04452020/04/26 01:10:220B / 105B / 21B

dc _

RankUserSizeTimeDateStatistics
1tails560.05262020/04/28 14:36:100B / 40B / 16B
2tails (xnor.py)530.05992020/04/29 00:52:250B / 36B / 17B

xgawk _

RankUserSizeTimeDateStatistics
1mitchs420.05392020/04/24 06:43:500B / 17B / 25B

R _

RankUserSizeTimeDateStatistics
1ludo690.41092020/04/28 23:38:100B / 46B / 23B
2olf720.38242020/04/22 19:04:350B / 42B / 28B

Brainfuck _

RankUserSizeTimeDateStatistics
1mitchs (cheat)1360.05702020/04/27 21:35:420B / 1B / 134B
2mitchs1470.05682020/04/27 09:46:340B / 0B / 147B
3mitchs (alt)1470.05412020/04/27 20:52:350B / 0B / 147B

GolfScript _

RankUserSizeTimeDateStatistics
1mitchs250.20182020/04/22 14:02:310B / 6B / 19B
2tails250.19762020/04/22 15:18:520B / 6B / 19B

gs2 _

RankUserSizeTimeDateStatistics
1mitchs80.26902020/04/22 11:47:263B / 4B / 0B
2tails80.26982020/04/22 13:29:083B / 4B / 0B

goruby _

RankUserSizeTimeDateStatistics
1olf330.09962020/04/23 14:51:160B / 17B / 16B
2mitchs330.09762020/04/23 18:35:010B / 17B / 16B
3ludo330.14122020/04/28 23:18:460B / 17B / 16B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o786.37412020/04/26 13:01:190B / 53B / 21B

Language Ranking_

RankLangUserSizeScore
1gs2mitchs810000
2GolfScriptmitchs253200
3gorubyolf332424
4Perltails402000
5AWKmitchs421904
6xgawkmitchs421904
7RubyHistocrat471702
8Ruby2mitchs491632
9dctails (xnor.py)531509
10OctaveHendrik671194
11Bash (builtins)tails (xnor.py)671194
12sedtails681176
13Rludo691159
14Scalarotary-o781025
15Python3mitchs791012
16Pythonxnor81987
17Cnu (tails)84952
18bcludo98816
19Brainfuckmitchs (cheat)136588

return to the top page