当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

4062:Abalone

题目描述
Abalone is a popular board game, the rules are as follow:
1.At first, two players each have 14 marbles, starting to play in turn.

2.For each turn, player must move a line of one, two or three adjacent marbles one space unless he couldn't move any marbles. The move can be either in-line (parallel to the line of marbles)

or broadside (not parallel to the line of marbles), as illustrated below.

3.A player can push their opponent′s marbles which are in an adjacent space to their own with an in-line move only. They can only push if the pushing line has more marbles than the pushed line (three can push two or one; two can push one). Marbles must be pushed into an open space or out of board(i.e. not blocked by a marble of either colour).

4.The winner is the first player to push six of the opponent's marbles off of the edge of the board.

Now, it's White player's turn to move, could White player win in this turn? If not, Black player moves, could Black player win in next turn no matter which move White player choose?
输入解释
The first line is a number T(1<=T<=30), which represents the number of case. The next T blocks follow each indicates a case.
A block has nine lines. They are the state of the situation.
'B' indicate the Black marble.
'W' indicate the White marble.
'.' indicate blank.
The number of marbles for each color will be no bigger than 14 and no smaller than 9.
输出解释
For each case, output the number of case with "White" or "Draw" or "Black".(as shown in the sample output)
输入样例
3
    B B B B B
   B B B B B B
  . . B B B . .
 . . . . . . . .
. . . . . . . . .
 . . . . . . . .
  . . W W W . .
   W W W W W W
    W W W W W

    . . . . .
   B B B B B B
  . W B B B . .
 . . W . . . . .
. . . W . . . . .
 . . . . . . . .
  . . . . . . .
   W W W W W W
    W W W W W

    . . . . .
   W B B B . .
  W W B B B . .
 W . W B B B . .
W W W W . . . . .
 . . . . . . . .
  . . . . . . .
   . . . . . .
    . . . . .
输出样例
Case 1: Draw
Case 2: White
Case 3: Black
来自杭电HDUOJ的附加信息
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-4062

最后修改于 2020-10-25T23:09:44+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000/1000MS(Java/Others) 65536/32768K(Java/Others)