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

建议使用的浏览器:

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

3649:New Game

题目描述
While ZSTU’s acmers were coding, coach Yehr was so bored that he created a new game to kill time. And the game is called “Yehr Game” because of the inventer.
Yehr Game is a board game involving two players. It is played on a board with 40 squares arranged in an ten-by-four grid. At the beginning of the game each player controls four pieces: one acm, one bahamas, one cab and one daze. If one player has no pieces to move, he lost the game.
Setup:
Yehr Game is played on a rectangle board of ten rows and four columns. The pieces are divided, by convention, into red and black sets. The players are referred to as "Red" and "Black", and each begins the game with four pieces of the specified color. These consist of one acm, one bahamas, one cab and one daze.



Movement:
First, they setup their pieces on the board.
(1) the piece red acm can be placed on A1~,A2,A3,A4,A5;the piece black acm A6~A10;
(2) the piece red bahamas can place on B1~B5; the piece black Bahamas B6~B10;
(3) the piece red cab can place on C1~C5; the piece black cab C6~C10;
(4) the piece red daze cab can place on D1~D5; the piece black daze D6~D10;
Second, they determine who moves first by dice. After the initial move, the players alternately move one piece at a time.
Each chess piece has its own style of moving.
(1) Acm can only move one direction: red from left to right; black from right to left. Acm can only move to the next square. If one player’s acm moves to a square with the opponent acm, he win the game.
(2) Bahamas and cab can move two direction: from left to right or from right to left. And they can move any number of squares but may not leap over other pieces.
(3) Daze can only move one direction: red from right to left; black from left to right.Daze can only move to the next square. In order to win the game, every clever player places the red daze on d5 and the black on d6.
Of Course, we assume that all players are clever.
输入解释
The input contains several test cases.
Each test case contains three lines:
First line contains one integer number 0 or 1: 0 indicated red move first and 1 black first.
Second line contains four integer numbers r1, r2, r3, r4 indicating the four red pieces’ square. For example, r3=3 indicating the red cab on C3.
Third line contains four integer numbers k1, k2, k3, k4 indicating the four black pieces’ square. For example, k1=9 indicating the black acm on A9.
We assume that r4 is always 5, and K4 is 6.

输出解释
For each test case, if red win print Red in a single line, else print Black.
输入样例
0
4 5 5 5
7 6 6 6
输出样例
Red
来自杭电HDUOJ的附加信息
Recommend lcy

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

源链接: HDU-3649

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

共提交 0

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