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

建议使用的浏览器:

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

7149:Alice and Bob

题目描述
Alice and Bob like playing games.

There are $m$ numbers written on the blackboard, all of which are integers between $0$ and $n$.

The rules of the game are as follows:

If there are still numbers on the blackboard, and there are no numbers with value $0$ on the blackboard, Alice can divide the remaining numbers on the blackboard into two sets.

Bob chooses one of the sets and erases all numbers in that set. Then subtract all remaining numbers by one.

At any time, if there is a number with a value of $0$ on the blackboard, Alice wins; otherwise, if all the numbers on the blackboard are erased, Bob wins.

Please determine who will win the game if both Alice and Bob play the game optimally.
输入解释
The first line contains an integer $T(T \le 2000)$ —the number of test cases.

The first line of each test case contains a single integers $n(1 \le \sum n \le 10^{6})$ .

The second line of each test case contains $n+1$ integers $a_0,a_1,a_2...a_n(0 \le a_i \le 10^{6} , \sum{a_i}=m)$ — there are $a_i$ numbers with value $i$ on the blackboard .
输出解释
For each test case, print "Alice" if Alice will win the game, otherwise print "Bob".
输入样例
2
1
0 1
1
0 2
输出样例
Bob
Alice

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

源链接: HDU-7149

最后修改于 2022-09-15T06:17:01+00:00 由爬虫自动更新

共提交 0

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