n in a row

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

A and B are playing n-in-a-row. The rule of this game is: two players put chess pieces onto a chess board that has the following positions: (1,1) on the upper left, and (n,n) on the lower right. If a player's n chess pieces form a row, a column, or a diagonal line, the other player loses.

A plays first, and there are m rounds. Please determine who won the game.

A game will end if and only if someone won, or there are no rounds left. If the upper conditions are fulfilled, the game ends, and the remaining rounds are ignored.

Inputs 2 numbers(n and m), which represent the size of the chessboard and the number of rounds.

x and y will be inputted in the next m lines. These show that the current player will put a chess piece on row x, column y.

Outputs a line, which include an integer x, which shows the number of rounds played when the game ends. Also, output a string S, which demonstrates the result of the game. These two outputs are separated using a space.

If A won, S is "milk!". If B won, S is "juice!". Otherwise, S is "drawn!".

Options

exec is denied

rejudge feature is enabled

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

Sample input:_

2 4
1 1
2 2
2 1
1 2

Sample output:

3 milk!

Ranking

Ruby2 _

RankUserSizeTimeDateStatistics
1pooq130.05142019/08/14 04:38:280B / ?B / ?B

Python3 _

RankUserSizeTimeDateStatistics
1c_r_5160.03952019/05/01 09:33:580B / ?B / ?B

PHP _

RankUserSizeTimeDateStatistics
1c_r_570.03922019/05/01 09:35:070B / ?B / ?B

Arc _

RankUserSizeTimeDateStatistics
1pooq130.70062019/08/08 11:25:140B / ?B / ?B

Clojure _

RankUserSizeTimeDateStatistics
1pooq160.60112019/08/10 05:30:370B / ?B / ?B

Io _

RankUserSizeTimeDateStatistics
1pooq140.04992019/07/17 06:35:280B / ?B / ?B

Xtal _

RankUserSizeTimeDateStatistics
1pooq120.01252019/08/08 17:21:180B / ?B / ?B

Crystal _

RankUserSizeTimeDateStatistics
1pooq140.00012019/08/12 18:06:570B / ?B / ?B

PARI/GP _

RankUserSizeTimeDateStatistics
1pooq210.01162019/08/10 04:22:350B / ?B / ?B

Squirrel _

RankUserSizeTimeDateStatistics
1pooq160.00012019/08/04 07:52:480B / ?B / ?B

Forth _

RankUserSizeTimeDateStatistics
1pooq100.01132019/08/15 13:20:070B / ?B / ?B

BASIC _

RankUserSizeTimeDateStatistics
1pooq100.00012019/07/16 15:46:470B / ?B / ?B

Chapel _

RankUserSizeTimeDateStatistics
1pooq170.01212019/08/11 10:44:110B / ?B / ?B

Octave _

RankUserSizeTimeDateStatistics
1pooq130.33232019/07/16 14:05:410B / ?B / ?B

REBOL _

RankUserSizeTimeDateStatistics
1pooq210.01852019/08/15 11:48:070B / ?B / ?B

Asymptote _

RankUserSizeTimeDateStatistics
1pooq150.21302019/07/24 11:15:310B / ?B / ?B

jq _

RankUserSizeTimeDateStatistics
1pooq90.01052019/07/15 19:00:330B / ?B / ?B

bc _

RankUserSizeTimeDateStatistics
1pooq100.01092019/07/24 04:48:470B / ?B / ?B

R _

RankUserSizeTimeDateStatistics
1pooq140.10552019/07/27 13:04:090B / ?B / ?B

QCL _

RankUserSizeTimeDateStatistics
1pooq160.04232019/08/08 19:17:300B / ?B / ?B

Burlesque _

RankUserSizeTimeDateStatistics
1pooq110.01312019/08/03 08:00:130B / ?B / ?B

z80 _

RankUserSizeTimeDateStatistics
1McBusLuck130.01202019/07/13 02:31:025B / 3B / 5B

DOS _

RankUserSizeTimeDateStatistics
1McBusLuck152.62102019/05/18 05:44:435B / ?B / ?B

Groovy _

RankUserSizeTimeDateStatistics
1pooq161.05922019/07/28 20:19:180B / ?B / ?B

Language Ranking_

RankLangUserSizeScore
1PHPc_r_5710000
2jqpooq97777
3BASICpooq107000
4bcpooq107000
5Forthpooq107000
6Burlesquepooq116363
7Xtalpooq125833
8z80McBusLuck135384
9Octavepooq135384
10Arcpooq135384
11Ruby2pooq135384
12Iopooq145000
13Rpooq145000
14Crystalpooq145000
15DOSMcBusLuck154666
16Asymptotepooq154666
17Python3c_r_5164375
18Groovypooq164375
19Squirrelpooq164375
20QCLpooq164375
21Clojurepooq164375
22Chapelpooq174117
23PARI/GPpooq213333
24REBOLpooq213333

return to the top page