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

建议使用的浏览器:

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

5754:Life Winner Bo

题目描述
Bo is a "Life Winner".He likes playing chessboard games with his girlfriend G.

The size of the chessboard is $N\times M$.The top left corner is numbered$(1,1)$ and the lower right corner is numberd $(N,M)$.

For each game,Bo and G take turns moving a chesspiece(Bo first).At first,the chesspiece is located at $(1,1)$.And the winner is the person who first moves the chesspiece to $(N,M)$.At one point,if the chess can't be moved and it isn't located at $(N,M)$,they end in a draw.

In general,the chesspiece can only be moved right or down.Formally,suppose it is located at $(x,y)$,it can be moved to the next point $(x',y')$ only if $x'\geq x$ and $y'\geq y$.Also it can't be moved to the outside of chessboard.

Besides,There are four kinds of chess(They have movement rules respectively).

1.king.

2.rook(castle).

3.knight.

4.queen.

(The movement rule is as same as the chess.)

For each type of chess,you should find out that who will win the game if they both play in an optimal strategy.

Print the winner's name("B" or "G") or "D" if nobody wins the game.
输入解释
In the first line,there is a number $T$ as a case number.

In the next $T$ lines,there are three numbers type,$N$ and $M$.

"type" means the kind of the chess.

$T\leq 1000,2\leq N,M\leq 1000,1\leq type\leq 4$
输出解释
For each question,print the answer.
输入样例
4
1 5 5
2 5 5
3 5 5
4 5 5
输出样例
G
G
D
B
来自杭电HDUOJ的附加信息
Author 绍兴一中
Recommend wange2014

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

源链接: HDU-5754

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

共提交 0

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