N Queens

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

N Queens problem.

The position of the queen expresses it as follows.

0 1 2 3 4
0 Q . . . .
1 . . Q . . -> 0 2 4 1 3
2 . . . . Q
3 . Q . . .
4 . . . Q .

Options

exec is denied

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

Sample input:_

5

Sample output:

0 2 4 1 3
0 3 1 4 2
1 3 0 2 4
1 4 2 0 3
2 0 3 1 4
2 4 1 3 0
3 0 2 4 1
3 1 4 2 0
4 1 3 0 2
4 2 0 3 1

Sample input:_

7

Sample output:

0 2 4 6 1 3 5
0 3 6 2 5 1 4
0 4 1 5 2 6 3
0 5 3 1 6 4 2
1 3 0 6 4 2 5
1 3 5 0 2 4 6
1 4 0 3 6 2 5
1 4 2 0 6 3 5
1 4 6 3 0 2 5
1 5 2 6 3 0 4
1 6 4 2 0 5 3
2 0 5 1 4 6 3
2 0 5 3 1 6 4
2 4 6 1 3 5 0
2 5 1 4 0 3 6
2 6 1 3 5 0 4
2 6 3 0 4 1 5
3 0 2 5 1 6 4
3 0 4 1 5 2 6
3 1 6 4 2 0 5
3 5 0 2 4 6 1
3 6 2 5 1 4 0
3 6 4 1 5 0 2
4 0 3 6 2 5 1
4 0 5 3 1 6 2
4 1 5 2 6 3 0
4 2 0 5 3 1 6
4 6 1 3 5 0 2
4 6 1 5 2 0 3
5 0 2 4 6 1 3
5 1 4 0 3 6 2
5 2 0 3 6 4 1
5 2 4 6 0 3 1
5 2 6 3 0 4 1
5 3 1 6 4 2 0
5 3 6 0 2 4 1
6 1 3 5 0 2 4
6 2 5 1 4 0 3
6 3 0 4 1 5 2
6 4 2 0 5 3 1

Sample input:_

8

Sample output:

0 4 7 5 2 6 1 3
0 5 7 2 6 3 1 4
0 6 3 5 7 1 4 2
0 6 4 7 1 3 5 2
1 3 5 7 2 0 6 4
1 4 6 0 2 7 5 3
1 4 6 3 0 7 5 2
1 5 0 6 3 7 2 4
1 5 7 2 0 3 6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 4
5 2 6 1 7 4 0 3
5 2 6 3 0 7 1 4
5 3 0 4 7 1 6 2
5 3 1 7 4 6 0 2
5 3 6 0 2 4 1 7
5 3 6 0 7 1 4 2
5 7 1 3 0 6 4 2
6 0 2 7 5 3 1 4
6 1 3 0 7 4 2 5
6 1 5 2 0 3 7 4
6 2 0 5 7 4 1 3
6 2 7 1 4 0 5 3
6 3 1 4 7 0 2 5
6 3 1 7 5 0 2 4
6 4 2 0 5 7 1 3
7 1 3 0 6 4 2 5
7 1 4 2 0 6 3 5
7 2 0 5 1 4 6 3
7 3 0 2 5 1 6 4

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1ksk960.88892008/07/24 22:18:210B / 43B / 43B
2leonid1000.42492008/07/16 23:34:530B / 49B / 43B
3flagitious1040.81132008/07/26 05:10:270B / 51B / 41B
4shinh1100.41032008/07/26 02:52:060B / 55B / 48B
5yowa1130.60762008/07/13 22:20:060B / 52B / 57B

Perl _

RankUserSizeTimeDateStatistics
1tails1170.37162012/03/05 09:28:250B / 43B / 72B

Python _

RankUserSizeTimeDateStatistics
1hirose1460.39412008/07/18 17:54:330B / 71B / 56B
2rolf2120.11622013/09/29 04:37:480B / 108B / 60B

Scheme _

RankUserSizeTimeDateStatistics
1murky-satyr2110.25682008/07/13 20:03:460B / 110B / 85B
2murky-satyr1910.46532008/07/30 03:19:250B / 106B / 74B

Common LISP _

RankUserSizeTimeDateStatistics
1kozima1720.78052008/08/19 15:02:430B / 81B / 69B
2_1731.00932009/07/15 20:49:271B / ?B / ?B

JavaScript _

RankUserSizeTimeDateStatistics
1murky-satyr1380.79992008/07/25 01:18:020B / 73B / 64B
2yowa1430.20692008/07/13 22:59:340B / 71B / 67B
3nn1640.99522008/07/19 20:54:300B / 82B / 79B
4murky-satyr1280.25062008/07/28 16:26:390B / 63B / 63B
5nn1350.18032008/07/27 16:30:080B / 62B / 71B

Lua _

RankUserSizeTimeDateStatistics
1murky-satyr1780.39732008/07/16 09:59:210B / 104B / 59B

Smalltalk _

RankUserSizeTimeDateStatistics
1murky-satyr1790.81132008/07/15 12:57:310B / 90B / 80B
2murky-satyr1740.93182008/07/28 16:37:380B / 89B / 76B

Prolog _

RankUserSizeTimeDateStatistics
1pooq2050.61492012/03/04 21:16:010B / 97B / 96B

BASIC _

RankUserSizeTimeDateStatistics
1pooq1770.54562008/07/16 04:59:140B / 107B / 48B

J _

RankUserSizeTimeDateStatistics
1pooq920.23002008/07/16 15:53:580B / 14B / 75B
2I., S.420.86522012/03/05 06:35:050B / 10B / 32B
3pooq651.21902009/11/29 10:23:180B / 10B / 55B

C _

RankUserSizeTimeDateStatistics
1funnything1440.14272008/07/13 22:06:390B / 70B / 74B
251b1550.12362008/07/15 19:54:480B / 77B / 77B
3not1350.00142009/12/06 12:44:140B / ?B / ?B
4hinoe1430.09252008/08/24 19:03:290B / 71B / 72B

OCaml _

RankUserSizeTimeDateStatistics
1ksk1910.29972009/09/09 22:56:410B / 115B / 61B
2xsd2160.30842009/09/09 22:49:490B / 112B / 82B

Haskell _

RankUserSizeTimeDateStatistics
1moriA1280.24712008/07/26 08:25:150B / ?B / ?B
2notogawa1340.17512008/07/23 23:41:200B / ?B / ?B
3fox1380.10882008/07/27 00:51:050B / 72B / 61B
4test1440.08252008/07/27 00:19:010B / 78B / 58B

Pascal _

RankUserSizeTimeDateStatistics
1uru2270.08322009/07/18 02:42:080B / 152B / 58B
2pooq3060.18802009/01/26 15:53:260B / 202B / 79B

AWK _

RankUserSizeTimeDateStatistics
1nn1361.02722008/07/16 22:42:400B / 75B / 54B

Postscript _

RankUserSizeTimeDateStatistics
1yshl(bin)1341.35542008/07/16 21:14:3358B / 50B / 24B
2yshl2371.39662008/07/16 20:52:250B / 169B / 23B

z80 _

RankUserSizeTimeDateStatistics
1kodera500.86682008/07/16 04:09:2930B / 9B / 5B

goruby _

RankUserSizeTimeDateStatistics
1murky-satyr811.04682008/07/16 08:29:550B / 38B / 38B
2murky-satyr721.12222010/01/04 01:35:030B / 29B / 40B

Language Ranking_

RankLangUserSizeScore
1JI., S.4210000
2z80kodera508400
3gorubymurky-satyr725833
4Rubyksk964375
5Perltails1173589
6HaskellmoriA1283281
7JavaScriptmurky-satyr1283281
8Postscriptyshl(bin)1343134
9Cnot1353111
10AWKnn1363088
11Pythonhirose1462876
12Common LISPkozima1722441
13Smalltalkmurky-satyr1742413
14BASICpooq1772372
15Luamurky-satyr1782359
16Schememurky-satyr1912198
17OCamlksk1912198
18Prologpooq2052048
19Pascaluru2271850

return top