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

建议使用的浏览器:

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

5345:MZL's combat

题目描述
MZL is an active boy.One day,he is playing a game with DSY and GTW.

The combat happened in a chessboard which has $R$ rows and $C$ columns.every grid has a parent.the parent of gird $(x,y)$ is $(x-1,y-1)$.the parent of grid $(1,y)$ is $(1,y-1)$ and the parent of grid $(x,1)$ is $(x-1,1)$,$(1,1)$has no parent.

Let's define $x$ is the ancestor of $y$ while one of the following conditions meets:
1.$x=y$
2.$x$ is the parent of an ancestor of $y$

Initially the nodes in the chessboard are either white or black.Every player takes turns to act.In each turn,the player can choose a white node and choose one of its ancestors,then the nodes which lies in the path from the chosen node to the chosen ancestor flip its color(white into black,black into white),the player who cannot act loses the game.GTW takes the first turn.

Suppose the two players act optimally,DSY wonders whether he will win the game.

In consideration of the large size of the chessboard.DSY gives a list of rectangles ,the initial white nodes is the union of the rectangles.
输入解释
the test data consists several cases.Please read until EOF.

the first line are 3 integers $n,R,C$,means the list size of the rectangles,the number of the rows and the number of the columns.

next $n$ lines ,each line has 4 integers,$x_1,y_1,x_2,y_2$,means the upper left and the lower right nodes of the rectangle.
$Cases \leq 16,n,R \leq 10^5,C \leq 10^9,x_1,x_2 \leq R,y_1,y_2\leq C$

And there are 8 big test cases and 8 small test cases
输出解释
if dsy has a strategy to win,print "DSY wins",otherwise,print "GTW wins"
输入样例
3 3 3
1 1 3 3
2 1 3 3
2 1 3 1
1 3 3
1 3 2 3
输出样例
GTW wins
DSY wins
来自杭电HDUOJ的附加信息
Author SXYZ
Recommend wange2014

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

源链接: HDU-5345

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

共提交 0

通过率 --%
时间上限 内存上限
11000/5500MS(Java/Others) 262144/262144K(Java/Others)