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

建议使用的浏览器:

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

6173:Boring Game

题目描述
YongChol is playing a game with his brother. The board is a N*N grid filled with coins. The players take turns to flip coins.
In each turn, the player selects a cell (x, y) (1 <= x, y <= N) with a coin facing up and two integers w, h (1 <= w <= x, 1 <= h <= y), and flips all coins inside the rectangle which bottom-right cell is (x, y) and top-left cell is (x – w + 1, y – h + 1).
The player who cannot move any more loses.
The game with his little brother is so boring that he wants to finish the game immediately. YongChol wants to know who will win the game if the two players play optimally from now on.
In consideration of the large size of the board, initial board state is given with a list of rectangles, the union of which represents the cells with a coin facing up.
YongChol is to take the next move. Can you help him?
输入解释
The first line of input contains an integer T(1<=T<=200), the number of test cases.
Each test case begins with two integer N (1<=N<=1e9), M(1<=M<=100000), the size of the board and the number of rectangles respectively.
The next M lines each contains 4 integers, x1,y1,x2, y2(1<=xi,yi<=N), the coordinates of the top-left and bottom-right corner of the rectangle.
The total sum of M over all test cases will not exceed 600000.
For 90% of the test cases, M will be smaller than 600.
输出解释
If YongChol wins the game, print “YongChol” and otherwise print “Brother” in a line for each test case.
输入样例
2
3 2
1 2 1 3
2 1 3 1
2 1
1 1 2 2
输出样例
Brother
Yong Chol
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6173

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

共提交 0

通过率 --%
时间上限 内存上限
10000/5000MS(Java/Others) 153428/153428K(Java/Others)