• 沒有找到結果。

Each move will consist of the coordinates of a square (integers in the range 1..N ) followed by a blank and a character

N/A
N/A
Protected

Academic year: 2021

Share "Each move will consist of the coordinates of a square (integers in the range 1..N ) followed by a blank and a character"

Copied!
2
0
0

加載中.... (立即查看全文)

全文

(1)

141 The Spot Game

The game of Spot is played on an N× N board as shown below for N = 4. During the game, alternate players may either place a black counter (spot) in an empty square or remove one from the board, thus producing a variety of patterns. If a board pattern (or its rotation by 90 degrees or 180 degrees) is repeated during a game, the player producing that pattern loses and the other player wins. The game terminates in a draw after 2N moves if no duplicate pattern is produced before then.

Consider the following patterns:

If the first pattern had been produced earlier, then any of the following three patterns (plus one other not shown) would terminate the game, whereas the last one would not.

Input

Input will consist of a series of games, each consisting of the size of the board, N (2 ≤ N ≤ 50) followed, on separate lines, by 2N moves, whether they are all necessary or not. Each move will consist of the coordinates of a square (integers in the range 1..N ) followed by a blank and a character ‘+’ or ‘-’

indicating the addition or removal of a spot respectively. You may assume that all moves are legal, that is there will never be an attempt to place a spot on an occupied square, nor to remove a non-existent spot. Input will be terminated by a zero (0).

Output

Output will consist of one line for each game indicating which player won and on which move, or that the game ended in a draw. See the Sample Output below for the exact format.

Sample Input 2

1 1 + 2 2 + 2 2 - 1 2 + 2 1 1 + 2 2 + 1 2 + 2 2 - 0

(2)

Universidad de Valladolid OJ: 141 – The Spot Game 2/2

Sample Output

Player 2 wins on move 3 Draw

參考文獻

相關文件

Fermat’s “little” theorem (p. 487) suggests the following primality test for any given number N:.. 1: Pick a number a randomly from {

Upon reception of a valid write command (CMD24 or CMD25 in the SD Memory Card protocol), the card will respond with a response token and will wait for a data block to be sent from

The resulting color at a spot reveals the relative levels of expression of a particular gene in the two samples, which may be from different tissues or the same tissue under

The condition of the proposition holds if K is a number field (Corollary 2.4.2), or if at every ramified place, A has either good ordinary reduction or split-multiplicative

If that circle is formed into a square so that the circumference of the original circle and the perimeter of the square are exactly the same, the sides of a pyramid constructed on

(a) The principal of a school shall nominate such number of teachers of the school for registration as teacher manager or alternate teacher manager of the school as may be provided

After teaching the use and importance of rhyme and rhythm in chants, an English teacher designs a choice board for students to create a new verse about transport based on the chant

A subgroup N which is open in the norm topology by Theorem 3.1.3 is a group of norms N L/K L ∗ of a finite abelian extension L/K.. Then N is open in the norm topology if and only if