multi_key sort

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 lines using specified field as key(s).
First line of the input specifies the key(s) (1 origin) and its precedense.

Options

exec is denied

no deadline, the server will not save your submission

Sample input:_

2
01845 47093 90019
23049 19449 84432
88601 19476 44123
22592 14783 17071
23950 22766 79966
43570 47302 31110
08982 92339 64456
43021 63307 18481
58439 90489 72666
97976 35464 43887
68041 11112 70733
25806 16233 40872
13373 59490 44956
26221 04205 60285
79737 71122 16755
22175 83122 11741
32496 29668 65579
31878 42019 42417
78192 50786 11319
08551 99355 26248

Sample output:

26221 04205 60285
68041 11112 70733
22592 14783 17071
25806 16233 40872
23049 19449 84432
88601 19476 44123
23950 22766 79966
32496 29668 65579
97976 35464 43887
31878 42019 42417
01845 47093 90019
43570 47302 31110
78192 50786 11319
13373 59490 44956
43021 63307 18481
79737 71122 16755
22175 83122 11741
58439 90489 72666
08982 92339 64456
08551 99355 26248

Sample input:_

4 1 2
5 E2F2 809A 0 9897
7 4F66 2AFD 2 FA8A
3 B673 BF35 1 5291
7 5177 0F43 2 AE95
8 0ADC DF2E 0 EF42
8 AAC7 18C3 0 D172
1 D14A 3B5D 2 B468
2 31F2 A8DB 1 84C2
E F914 2468 1 A4A7
C 7904 742C 1 6EB1

Sample output:

5 E2F2 809A 0 9897
8 0ADC DF2E 0 EF42
8 AAC7 18C3 0 D172
2 31F2 A8DB 1 84C2
3 B673 BF35 1 5291
C 7904 742C 1 6EB1
E F914 2468 1 A4A7
1 D14A 3B5D 2 B468
7 4F66 2AFD 2 FA8A
7 5177 0F43 2 AE95

Sample input:_

3 4 2 6
aSzVUd4 0998 1 A 3399 1
BjE2rWF 0998 0 A 5E9C L
yqLVF5D 0997 0 B B74A i
ft5/ZSE 0998 1 A D93C w
X0JGaL3 0998 2 A 88A0 h
ZVVLCN2 0999 0 B 5554 d
b6UGQvI 0999 0 B F3BF L
RmlTWIU 0997 2 B 5EC4 E
MPADZc6 0997 2 B B57C M
oFnT7d4 0997 0 B B86C V
lTDDoTS 0997 1 B F2AB w
jogFIFt 0999 2 B E74E i
oGV0qVq 0997 0 B A46C A
bDzqVmt 0998 1 B 3D9B t
6ymSYsx 0998 1 A E293 D
ZxRVPmA 0999 1 A 33B6 I
xjmfx4f 0999 1 B D4AA D
IEPFgzI 0999 2 B BA14 I
OurHcHr 0998 2 A D6B9 p
Nv8l4vt 0997 2 B 6C43 +
13FFrXG 0998 2 B 3748 m
xyFXZNN 0997 0 B 84E9 N
+YKj6OT 0998 1 A D808 J
YyAGASM 0997 1 B 324F F
1ZxGEHS 0999 0 A 9F28 m
69ObSsF 0999 0 A 0D56 p
nHi7WLh 0997 2 B DAF1 f
5xIZnR1 0997 2 B A547 b
wcwnqDi 0997 2 B C79D s
fImI9FF 0997 0 A 5F49 p

Sample output:

fImI9FF 0997 0 A 5F49 p
BjE2rWF 0998 0 A 5E9C L
1ZxGEHS 0999 0 A 9F28 m
69ObSsF 0999 0 A 0D56 p
oGV0qVq 0997 0 B A46C A
xyFXZNN 0997 0 B 84E9 N
oFnT7d4 0997 0 B B86C V
yqLVF5D 0997 0 B B74A i
b6UGQvI 0999 0 B F3BF L
ZVVLCN2 0999 0 B 5554 d
aSzVUd4 0998 1 A 3399 1
6ymSYsx 0998 1 A E293 D
+YKj6OT 0998 1 A D808 J
ft5/ZSE 0998 1 A D93C w
ZxRVPmA 0999 1 A 33B6 I
YyAGASM 0997 1 B 324F F
lTDDoTS 0997 1 B F2AB w
bDzqVmt 0998 1 B 3D9B t
xjmfx4f 0999 1 B D4AA D
X0JGaL3 0998 2 A 88A0 h
OurHcHr 0998 2 A D6B9 p
Nv8l4vt 0997 2 B 6C43 +
RmlTWIU 0997 2 B 5EC4 E
MPADZc6 0997 2 B B57C M
5xIZnR1 0997 2 B A547 b
nHi7WLh 0997 2 B DAF1 f
wcwnqDi 0997 2 B C79D s
13FFrXG 0998 2 B 3748 m
IEPFgzI 0999 2 B BA14 I
jogFIFt 0999 2 B E74E i

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid530.11562009/04/30 17:35:400B / 29B / 23B
2yowa540.18702007/11/27 23:22:560B / 25B / 27B
3jpl540.03822014/06/21 05:45:350B / ?B / ?B
4Histocrat540.04912015/10/05 21:41:560B / 25B / 27B
5_N550.28712007/03/05 02:33:270B / 29B / 26B
6niha550.28292007/08/18 07:19:230B / 27B / 26B
7flagitious550.18892007/12/15 14:19:170B / 31B / 23B
8murky-satyr550.05272010/03/08 03:55:520B / 28B / 26B
9usa570.29782007/02/19 10:54:450B / 29B / 27B
10eban570.28102007/02/19 11:29:330B / 35B / 22B
11clock580.03812012/08/17 18:42:320B / 26B / 31B
12shinh740.65162007/02/18 08:05:060B / 34B / 39B
13tabasa1850.14332007/11/27 09:47:5114B / 93B / 55B

Perl _

RankUserSizeTimeDateStatistics
1tails630.11602011/11/21 23:01:230B / 30B / 30B
2Mithran640.14322007/05/18 18:28:270B / ?B / ?B
3eban650.12482007/02/17 23:20:270B / 28B / 36B
4kounoike690.14762007/02/21 02:23:170B / ?B / ?B
5mikimoto1110.07182007/12/24 04:21:570B / ?B / ?B

Python _

RankUserSizeTimeDateStatistics
1twobit1010.10822014/03/04 07:32:530B / 59B / 36B
2leonid1010.09382014/05/30 07:56:500B / 59B / 36B
3hallvabo1060.08312010/10/22 18:27:070B / 68B / 31B
4recursive1090.11112009/01/11 05:37:130B / 74B / 28B
5z1180.07542010/04/03 08:08:130B / 74B / 36B
6SeeNoEvil1200.36512007/03/04 06:29:360B / 79B / 28B
7mskzzzz1510.36712007/06/16 02:26:010B / 94B / 42B
8Bakuriu1510.10022013/03/26 18:41:130B / ?B / ?B
9zeek5350.35032007/03/25 01:52:440B / 267B / 82B

Python3 _

RankUserSizeTimeDateStatistics
1Stephan W.1190.17512015/07/14 23:31:340B / 77B / 31B

PHP _

RankUserSizeTimeDateStatistics
1o-cn1130.05042010/01/05 18:33:3652B / 37B / 24B
2mskzzzz1940.48812007/06/13 03:27:540B / 111B / 76B

Scheme _

RankUserSizeTimeDateStatistics
1kaki1740.24902011/06/12 20:12:010B / 96B / 70B
2murky-satyr1870.22922008/07/05 09:17:020B / 106B / 68B
3ma1930.64092007/03/07 19:48:310B / ?B / ?B

Common LISP _

RankUserSizeTimeDateStatistics
1kozima2600.90102007/05/10 09:26:591B / 148B / 95B

Arc _

RankUserSizeTimeDateStatistics
1murky-satyr954.02602010/03/08 10:07:320B / 55B / 34B

Clojure _

RankUserSizeTimeDateStatistics
1murky-satyr1483.10412010/03/08 09:55:190B / 89B / 49B

Io _

RankUserSizeTimeDateStatistics
1murky-satyr1223.29722008/05/03 20:12:540B / 88B / 29B

JavaScript _

RankUserSizeTimeDateStatistics
1murky-satyr1130.18462008/05/03 19:42:130B / 57B / 52B
2nn1180.11372008/05/05 22:12:580B / 60B / 54B
3Dashiva1970.17672007/04/21 02:47:300B / 99B / 89B

Lua _

RankUserSizeTimeDateStatistics
1twobit1830.03322014/03/02 05:48:550B / 111B / 52B
2clock2060.03652012/08/13 17:45:530B / 120B / 74B
3murky-satyr2160.07002008/05/30 06:38:130B / 130B / 66B

Tcl _

RankUserSizeTimeDateStatistics
1clock1310.04302012/08/27 19:20:490B / 82B / 25B
2murky-satyr1560.10162008/07/08 11:47:080B / 96B / 29B
3user1660.13122007/03/22 02:11:110B / ?B / ?B

Smalltalk _

RankUserSizeTimeDateStatistics
1murky-satyr2010.79942008/07/16 04:30:050B / 121B / 66B

Prolog _

RankUserSizeTimeDateStatistics
1mskzzzz3352.05942007/05/30 16:30:490B / 172B / 156B

Perl6 _

RankUserSizeTimeDateStatistics
1murky-satyr6212.08902011/06/18 18:03:520B / 30B / 30B

J _

RankUserSizeTimeDateStatistics
1I., S.440.12432010/12/24 06:54:090B / 17B / 26B
2pooq650.12672008/03/15 23:05:150B / 20B / 42B

K _

RankUserSizeTimeDateStatistics
1teebee370.02802013/05/05 09:36:360B / 10B / 25B
2clock380.02982013/04/13 12:14:200B / 10B / 25B
3twobit400.05102012/03/23 22:26:030B / 11B / 25B

C _

RankUserSizeTimeDateStatistics
1twobit1970.03222014/02/28 09:00:340B / 110B / 87B
27gyou1980.03162008/05/24 17:47:330B / 103B / 95B
351b2050.04662008/03/27 22:25:470B / 114B / 90B
4hinoe2970.08922007/03/21 15:19:180B / 142B / 155B

D _

RankUserSizeTimeDateStatistics
151b1750.04552008/03/27 22:28:560B / 115B / 57B

OCaml _

RankUserSizeTimeDateStatistics
1m.ukai2630.32642007/03/06 20:16:420B / 168B / 74B

Haskell _

RankUserSizeTimeDateStatistics
1notogawa980.00382010/03/13 11:24:230B / ?B / ?B
2rst76980.00392010/03/18 23:37:370B / 59B / 34B
3henkma980.00742011/09/04 06:56:100B / 59B / 34B
4Lost_dog1060.00642010/08/06 18:36:390B / 72B / 27B
5_1130.08132007/02/17 21:29:430B / ?B / ?B
6tanakh1160.12512007/02/17 18:14:430B / ?B / ?B
7blue1440.08532007/02/17 17:09:100B / 86B / 46B
8halt1550.10912007/02/24 11:12:000B / 105B / 32B

AWK _

RankUserSizeTimeDateStatistics
1nn1230.05602008/12/26 00:40:250B / 55B / 66B
2usa1250.56192007/02/28 23:02:520B / 50B / 72B
3eban1330.07412007/03/06 01:12:080B / 58B / 71B

jq _

RankUserSizeTimeDateStatistics
1clock620.03512015/02/11 14:29:190B / 21B / 38B

Bash _

RankUserSizeTimeDateStatistics
1waldner360.15082008/11/13 22:45:350B / 18B / 15B
2eban370.24082007/03/20 01:31:260B / 17B / 16B
3ninjalj410.05962011/02/15 07:52:270B / 18B / 18B
4ma480.16102007/02/17 22:45:230B / ?B / ?B

xgawk _

RankUserSizeTimeDateStatistics
1eban1020.13442007/03/06 01:55:050B / 47B / 55B

Postscript _

RankUserSizeTimeDateStatistics
1ySas1580.85242007/06/06 13:51:5167B / 54B / 36B

R _

RankUserSizeTimeDateStatistics
1NikNakk1440.41892014/07/06 06:19:050B / ?B / ?B

GolfScript _

RankUserSizeTimeDateStatistics
1tails270.68212011/11/22 01:10:500B / 8B / 18B
2narb280.16472010/09/05 17:02:300B / ?B / ?B
3flagitious310.52062007/12/15 14:32:050B / 7B / 23B

Burlesque _

RankUserSizeTimeDateStatistics
1clock240.06902013/04/29 20:13:470B / 14B / 10B

z80 _

RankUserSizeTimeDateStatistics
1kodera860.07212008/01/18 22:56:0649B / 17B / 9B

Vim _

RankUserSizeTimeDateStatistics
1clock(!!)280.09762011/11/21 01:27:501B / 13B / 11B
2nn(!!)280.08802011/11/21 02:20:181B / 12B / 12B
3clock290.10602011/12/10 02:28:011B / 13B / 11B
4nn410.09512011/11/21 01:03:294B / 27B / 9B
5clock(oops)520.08312011/11/22 01:35:483B / 29B / 14B

goruby _

RankUserSizeTimeDateStatistics
1murky-satyr370.38122008/10/26 20:19:390B / 14B / 22B
2leonid370.26762008/12/15 21:43:250B / 14B / 23B

Groovy _

RankUserSizeTimeDateStatistics
1murky-satyr906.20272010/08/22 21:59:310B / 55B / 34B
2nn983.59672009/12/28 14:04:220B / 62B / 34B
3hoozie10110.33052008/04/02 00:22:590B / 60B / 40B

Scala _

RankUserSizeTimeDateStatistics
1murky-satyr10812.60862012/06/18 11:29:420B / 76B / 26B
2tarhashi26913.44382012/06/13 18:53:270B / ?B / ?B

Language Ranking_

RankLangUserSizeScore
1Burlesqueclock2410000
2GolfScripttails278888
3Vimclock(!!)288571
4Bashwaldner366666
5gorubymurky-satyr376486
6Kteebee376486
7JI., S.445454
8Rubyleonid534528
9Perl6murky-satyr623870
10jqclock623870
11Perltails633809
12z80kodera862790
13Groovymurky-satyr902666
14Arcmurky-satyr952526
15Haskellnotogawa982448
16Pythontwobit1012376
17xgawkeban1022352
18Scalamurky-satyr1082222
19JavaScriptmurky-satyr1132123
20PHPo-cn1132123
21Python3Stephan W.1192016
22Iomurky-satyr1221967
23AWKnn1231951
24Tclclock1311832
25RNikNakk1441666
26Clojuremurky-satyr1481621
27PostscriptySas1581518
28Schemekaki1741379
29D51b1751371
30Luatwobit1831311
31Ctwobit1971218
32Smalltalkmurky-satyr2011194
33Common LISPkozima260923
34OCamlm.ukai263912
35Prologmskzzzz335716

Referer

Note that, they may contain spoilers.

return top