Sharkovskii order

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

Sort given numbers into Sharkovskii order.

Sharkovskii order:
3,5,7,9,...,6,10,14,18,...,12,20,28,36,...,16,8,4,2,1

http://en.wikipedia.org/wiki/Sharkovsky%27s_theorem

Options

exec is denied

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

Sample input:_

1
2
3
4
5
6
7
8
9
10

Sample output:

3
5
7
9
6
10
8
4
2
1

Sample input:_

3
14
15
92
65
35
89
79
32
38
46
26
43

Sample output:

3
15
35
43
65
79
89
14
26
38
46
92
32

Sample input:_

1
2
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
2584
4181
6765
10946
17711
28657
46368
75025
121393
196418
317811
514229
832040
1346269
2178309
3524578
5702887
9227465
14930352
24157817
39088169

Sample output:

3
5
13
21
55
89
233
377
987
1597
4181
6765
17711
28657
75025
121393
317811
514229
1346269
2178309
5702887
9227465
24157817
39088169
34
610
10946
196418
3524578
2584
832040
144
14930352
46368
8
2
1

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid490.00822010/08/01 18:24:290B / 25B / 24B
2ksk490.04952010/08/02 21:53:380B / 15B / 33B
3murky-satyr490.04832010/08/02 22:41:420B / 25B / 24B
4kik490.05132010/08/02 23:58:450B / 23B / 26B
5yvl490.04802010/08/10 12:07:530B / 19B / 30B
6shinh530.02252010/08/02 00:57:290B / 20B / 32B
7msk920.00932010/08/01 22:46:480B / 50B / 38B

Perl _

RankUserSizeTimeDateStatistics
1tails (nai @C)510.03212018/08/13 16:17:420B / 22B / 27B

Python _

RankUserSizeTimeDateStatistics
1primo990.07842010/08/13 18:49:540B / 65B / 27B
2hallvabo1060.07032010/08/12 21:43:050B / 63B / 36B
3primo (hallvabo)880.07022010/08/17 06:37:550B / 53B / 30B

PHP _

RankUserSizeTimeDateStatistics
1o-cn870.08382010/08/19 20:55:591B / 40B / 46B

Common LISP _

RankUserSizeTimeDateStatistics
1kozima1210.15672010/08/05 14:37:550B / 66B / 44B
2youz1210.16362010/08/06 13:34:560B / 65B / 47B
3quijote1570.15802010/08/04 07:26:260B / 90B / 52B

JavaScript _

RankUserSizeTimeDateStatistics
1murky-satyr950.00532010/08/13 21:32:150B / 52B / 40B
2nn1310.00462010/08/07 21:24:460B / 76B / 54B
3murky-satyr890.04072010/08/23 06:54:440B / 44B / 45B
4xulapp(murky-satyr)910.01222010/08/15 18:12:220B / 49B / 42B

Perl6 _

RankUserSizeTimeDateStatistics
1murky-satyr538.84462010/08/08 12:56:460B / 20B / 33B

J _

RankUserSizeTimeDateStatistics
1pooq620.07512011/09/18 08:56:420B / 16B / 44B

C _

RankUserSizeTimeDateStatistics
1nai1360.00242010/08/06 05:07:050B / 65B / 70B
2not1980.00172010/08/05 16:16:350B / 91B / 106B
3nai1020.03152018/08/13 12:37:5321B / 42B / 39B
4nai(no asm)1170.03152018/08/13 02:38:140B / 57B / 60B

Haskell _

RankUserSizeTimeDateStatistics
1notogawa1080.00452010/08/10 22:15:450B / ?B / ?B
2rst761100.00432010/08/10 21:07:500B / 66B / 36B
3Lost_dog1130.01212010/08/15 02:46:290B / 77B / 29B

GolfScript _

RankUserSizeTimeDateStatistics
1murky-satyr260.15882010/08/10 23:04:010B / 5B / 21B
2yvl360.16652010/08/11 00:24:330B / 13B / 23B
3tails220.05602018/08/14 01:06:520B / 3B / 19B

gs2 _

RankUserSizeTimeDateStatistics
1tails150.20862018/08/13 22:36:263B / 6B / 4B

goruby _

RankUserSizeTimeDateStatistics
1leonid380.13162010/08/01 18:30:230B / 17B / 19B
2murky-satyr380.14722010/08/02 22:40:440B / 16B / 21B

Groovy _

RankUserSizeTimeDateStatistics
1murky-satyr796.55922010/08/14 04:00:070B / 43B / 36B

Language Ranking_

RankLangUserSizeScore
1gs2tails1510000
2GolfScripttails226818
3gorubyleonid383947
4Rubyleonid493061
5Perltails (nai @C)512941
6Perl6murky-satyr532830
7Jpooq622419
8Groovymurky-satyr791898
9PHPo-cn871724
10Pythonprimo (hallvabo)881704
11JavaScriptmurky-satyr891685
12Cnai1021470
13Haskellnotogawa1081388
14Common LISPkozima1211239

return to the top page