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

建议使用的浏览器:

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

BZOJ3497:Pa2009 Circular Game

题目描述

一个大小为m的轮盘,上面有a个白棋子,b个黑棋子。
白棋先行,每次可以走到一个中间没有任何棋子的位
。例如下图中,8号棋子可以走到1、7、9-个位置。

哪方先不能移动就输。问哪方能赢,或者判断游戏永远
  无法结束。
 1 < =M<= 1000000000,1<=a+b<= 1000000。

输入解释

The first line of the standard input contains one integer t representing the number of boards to be considered. The following lines contain descriptions of respective boards, each of which consists of three lines. In the first line there are three integers m, b and c (1<=M<=10^9,1<=b,c) separated by single spaces and denoting the length of the board, the number of white pieces and the number of black pieces. In the second line there is an increasing sequence of b integers (in the range 1……m) representing the positions of white pieces. In the third line there is an increasing sequence of integers (in the range 1……m) representing the positions of black pieces. The total number of pieces in all boards does not exceed 10^6.

输出解释

Exactly lines with answers for consecutive boards should be written to the standard output. The answer is always a single character: B, C, or R, depending on whether the white player wins (B), the black player wins (C) or the game never ends (R).

输入样例
3
9 2 3
3 8
2 5 6
6 2 2
5 6
2 4
7 1 1
3
4
输出样例
C
B
R
提示

BZPRO Powered by Remmina.
Github Repository
来自acmore.cc的附加信息
bzoj_id 3497
import_source_sha256 0baac55018ae8c90ed6e9fc5374b98b564939809f089191d4d0cd9d8d1ee6062
bzoj_checker_pending False

该题目包含在题集 大视野(八中)OJ 中

题目来源 BZOJ 3497

源链接: LOCAL-BZOJ3497

共提交 0 次

通过率 --%
时间上限 内存上限
10000 MS 128 MB