n in a row
Submit
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
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 13 | 0.0514 | 2019/08/14 04:38:28 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 17 | 0.0182 | 2019/10/13 13:53:50 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 13 | 0.7006 | 2019/08/08 11:25:14 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 16 | 0.6011 | 2019/08/10 05:30:37 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 14 | 0.0499 | 2019/07/17 06:35:28 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 16 | 0.0119 | 2019/10/09 07:25:28 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 14 | 0.0133 | 2019/08/19 11:21:29 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 12 | 0.0125 | 2019/08/08 17:21:18 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 14 | 0.0001 | 2019/08/12 18:06:57 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 12 | 0.0189 | 2019/10/13 20:39:15 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 21 | 0.0116 | 2019/08/10 04:22:35 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 16 | 0.0001 | 2019/08/04 07:52:48 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 21 | 0.0138 | 2019/10/14 07:10:44 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 10 | 0.0113 | 2019/08/15 13:20:07 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 10 | 0.0001 | 2019/07/16 15:46:47 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 16 | 0.0699 | 2019/09/01 22:01:06 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 12 | 0.0141 | 2021/04/13 15:24:36 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 34 | 0.0002 | 2019/10/13 18:43:48 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 28 | 0.0112 | 2019/10/12 08:05:18 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 27 | 0.0001 | 2019/10/13 16:29:01 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 17 | 0.0121 | 2019/08/11 10:44:11 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 18 | 0.4429 | 2019/10/17 12:17:29 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 13 | 0.3323 | 2019/07/16 14:05:41 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 21 | 0.0185 | 2019/08/15 11:48:07 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 15 | 0.2130 | 2019/07/24 11:15:31 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 9 | 0.0105 | 2019/07/15 19:00:33 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 10 | 0.0109 | 2019/07/24 04:48:47 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 10 | 0.0001 | 2019/10/15 09:36:34 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 7 | 0.0001 | 2019/08/19 12:55:37 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 10 | 0.0716 | 2019/10/06 06:15:52 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 14 | 0.1055 | 2019/07/27 13:04:09 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 16 | 0.0423 | 2019/08/08 19:17:30 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 25 | 0.0580 | 2021/04/01 17:50:43 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 10 | 0.2452 | 2020/12/25 11:47:21 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 11 | 0.0131 | 2019/08/03 08:00:13 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 10 | 0.0189 | 2019/08/21 05:19:55 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 16 | 1.0592 | 2019/07/28 20:19:18 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 16 | 1.4384 | 2021/04/03 03:35:25 | 0B / ?B / ?B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | Jelly | Erik the Outgolfer | 6 | 10000 |
2 | PHP | c_r_5 | 7 | 8571 |
3 | m4 | pooq | 7 | 8571 |
4 | jq | pooq | 9 | 6666 |
5 | BASIC | pooq | 10 | 6000 |
6 | bc | pooq | 10 | 6000 |
7 | Forth | pooq | 10 | 6000 |
8 | goruby | pooq | 10 | 6000 |
9 | Postscript | pooq | 10 | 6000 |
10 | dc | pooq | 10 | 6000 |
11 | FlogScript | pooq | 10 | 6000 |
12 | Burlesque | pooq | 11 | 5454 |
13 | Zsh | Erik the Outgolfer | 11 | 5454 |
14 | Xtal | pooq | 12 | 5000 |
15 | REXX | pooq | 12 | 5000 |
16 | ><> | pooq | 12 | 5000 |
17 | Bash | Erik the Outgolfer | 12 | 5000 |
18 | Bash (builtins) | Erik the Outgolfer | 12 | 5000 |
19 | K | pooq | 12 | 5000 |
20 | z80 | McBusLuck | 13 | 4615 |
21 | Octave | pooq | 13 | 4615 |
22 | Arc | pooq | 13 | 4615 |
23 | Ruby2 | pooq | 13 | 4615 |
24 | Io | pooq | 14 | 4285 |
25 | R | pooq | 14 | 4285 |
26 | Crystal | pooq | 14 | 4285 |
27 | Tcl | pooq | 14 | 4285 |
28 | Python | Erik the Outgolfer | 14 | 4285 |
29 | DOS | McBusLuck | 15 | 4000 |
30 | Asymptote | pooq | 15 | 4000 |
31 | Python3 | c_r_5 | 16 | 3750 |
32 | Groovy | pooq | 16 | 3750 |
33 | Squirrel | pooq | 16 | 3750 |
34 | QCL | pooq | 16 | 3750 |
35 | Clojure | pooq | 16 | 3750 |
36 | J | pooq | 16 | 3750 |
37 | JavaScript | pooq | 16 | 3750 |
38 | Scala | pooq | 16 | 3750 |
39 | Chapel | pooq | 17 | 3529 |
40 | Common LISP | pooq | 17 | 3529 |
41 | Maxima | pooq | 18 | 3333 |
42 | PARI/GP | pooq | 21 | 2857 |
43 | REBOL | pooq | 21 | 2857 |
44 | Prolog | pooq | 21 | 2857 |
45 | C | Erik the Outgolfer | 24 | 2500 |
46 | Labyrinth | pooq | 25 | 2400 |
47 | Pascal | pooq | 27 | 2222 |
48 | Rust | pooq | 28 | 2142 |
49 | C++ | pooq | 34 | 1764 |
50 | FerNANDo | Erik the Outgolfer | 115 | 521 |
return to the top page