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

Python _

RankUserSizeTimeDateStatistics
1Erik the Outgolfer140.03242020/11/14 09:04:010B / 10B / 3B

Python3 _

RankUserSizeTimeDateStatistics
1c_r_5160.03952019/05/01 09:33:580B / ?B / ?B
2Erik the Outgolfer160.04482020/11/14 09:04:120B / 10B / 5B

PHP _

RankUserSizeTimeDateStatistics
1c_r_570.03922019/05/01 09:35:070B / ?B / ?B
2Erik the Outgolfer70.02352020/11/14 09:01:110B / 5B / 1B

Common LISP _

RankUserSizeTimeDateStatistics
1pooq170.01822019/10/13 13:53:500B / ?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

JavaScript _

RankUserSizeTimeDateStatistics
1pooq160.01192019/10/09 07:25:280B / ?B / ?B
2#c0ffee160.02032025/01/30 20:45:190B / ?B / ?B

Tcl _

RankUserSizeTimeDateStatistics
1pooq140.01332019/08/19 11:21:290B / ?B / ?B

Xtal _

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

Crystal _

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

REXX _

RankUserSizeTimeDateStatistics
1pooq120.01892019/10/13 20:39:150B / ?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

Prolog _

RankUserSizeTimeDateStatistics
1pooq210.01382019/10/14 07:10:440B / ?B / ?B

Forth _

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

BASIC _

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

J _

RankUserSizeTimeDateStatistics
1pooq160.06992019/09/01 22:01:060B / ?B / ?B

K _

RankUserSizeTimeDateStatistics
1pooq120.01412021/04/13 15:24:360B / ?B / ?B

Jelly _

RankUserSizeTimeDateStatistics
1Erik the Outgolfer60.27672021/05/19 16:56:086B / 0B / 0B

iogii _

RankUserSizeTimeDateStatistics
1#c0ffee80.01912025/01/30 20:45:410B / ?B / ?B

C _

RankUserSizeTimeDateStatistics
1Erik the Outgolfer240.01372020/11/14 09:01:410B / 13B / 10B

C++ _

RankUserSizeTimeDateStatistics
1pooq340.00022019/10/13 18:43:480B / ?B / ?B

Rust _

RankUserSizeTimeDateStatistics
1pooq280.01122019/10/12 08:05:180B / ?B / ?B

Pascal _

RankUserSizeTimeDateStatistics
1pooq270.00012019/10/13 16:29:010B / ?B / ?B

Chapel _

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

Maxima _

RankUserSizeTimeDateStatistics
1pooq180.44292019/10/17 12:17:290B / ?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

Bash _

RankUserSizeTimeDateStatistics
1Erik the Outgolfer120.01442020/11/14 08:59:380B / 9B / 1B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1Erik the Outgolfer120.01432020/11/14 08:59:430B / 9B / 1B

Zsh _

RankUserSizeTimeDateStatistics
1Erik the Outgolfer110.00662020/11/14 09:00:020B / 5B / 5B

bc _

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

dc _

RankUserSizeTimeDateStatistics
1pooq100.00012019/10/15 09:36:340B / ?B / ?B

m4 _

RankUserSizeTimeDateStatistics
1pooq70.00012019/08/19 12:55:370B / ?B / ?B

Postscript _

RankUserSizeTimeDateStatistics
1pooq100.07162019/10/06 06:15:520B / ?B / ?B

R _

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

QCL _

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

Labyrinth _

RankUserSizeTimeDateStatistics
1pooq250.05802021/04/01 17:50:430B / ?B / ?B

><> _

RankUserSizeTimeDateStatistics
1pooq120.05322019/10/16 11:06:090B / ?B / ?B
2Erik the Outgolfer120.06082020/11/14 08:58:570B / 6B / 5B

FlogScript _

RankUserSizeTimeDateStatistics
1pooq100.24522020/12/25 11:47:210B / ?B / ?B

Burlesque _

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

FerNANDo _

RankUserSizeTimeDateStatistics
1Erik the Outgolfer1150.03992020/11/14 09:03:450B / 58B / 0B

z80 _

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

DOS _

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

goruby _

RankUserSizeTimeDateStatistics
1pooq100.01892019/08/21 05:19:550B / ?B / ?B

Groovy _

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

Scala _

RankUserSizeTimeDateStatistics
1pooq161.43842021/04/03 03:35:250B / ?B / ?B

Language Ranking_

RankLangUserSizeScore
1JellyErik the Outgolfer610000
2PHPc_r_578571
3m4pooq78571
4iogii#c0ffee87500
5jqpooq96666
6BASICpooq106000
7bcpooq106000
8Forthpooq106000
9gorubypooq106000
10Postscriptpooq106000
11dcpooq106000
12FlogScriptpooq106000
13Burlesquepooq115454
14ZshErik the Outgolfer115454
15Xtalpooq125000
16REXXpooq125000
17><>pooq125000
18BashErik the Outgolfer125000
19Bash (builtins)Erik the Outgolfer125000
20Kpooq125000
21z80McBusLuck134615
22Octavepooq134615
23Arcpooq134615
24Ruby2pooq134615
25Iopooq144285
26Rpooq144285
27Crystalpooq144285
28Tclpooq144285
29PythonErik the Outgolfer144285
30DOSMcBusLuck154000
31Asymptotepooq154000
32Python3c_r_5163750
33Groovypooq163750
34Squirrelpooq163750
35QCLpooq163750
36Clojurepooq163750
37Jpooq163750
38JavaScriptpooq163750
39Scalapooq163750
40Chapelpooq173529
41Common LISPpooq173529
42Maximapooq183333
43PARI/GPpooq212857
44REBOLpooq212857
45Prologpooq212857
46CErik the Outgolfer242500
47Labyrinthpooq252400
48Pascalpooq272222
49Rustpooq282142
50C++pooq341764
51FerNANDoErik the Outgolfer115521

return to the top page