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

建议使用的浏览器:

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

6944:Game

题目描述
Alice and Bob are playing a game. They take turns and Alice moves first. There is a set of positive integers. In one's turn, he or she can choose a number (suppose $x$) in the set, and choose a positive integer $k$ ($k$ does not need to be in the set), and replace $x$ with $x-(10^k-1)$. For example, you can make a number $x$ in the set become $x-9$ or $x-99$ or $x-999$ or $x-999\cdots$. After that the set must still be a set of positive integers. That is to say:


* The number must still be positive: $x-(10^k-1) > 0$.
* A set can not have duplicate elements: $x-(10^k-1)$ can not be equal to any other numbers in the set.

They take turns and Alice moves first. The one who can't move loses the game. Now the question is that who will win the game if they play optimally.
输入解释
There are multiple test cases.

For each test case, the first line contains a number $N$, denoting the number of numbers in the set.

The second line contains $N$ different positive integers $A_1, A_2, \ldots, A_N$, denoting the numbers in the set.

It's guaranteed that $1\leq A_i \leq 10^9$, and the sum of $N$ of all test cases is not larger than $2 \cdot 10^5$.
输出解释
For each test case, print ``A'' for Alice or ``B'' for Bob in one line, denoting the winner.
输入样例
3
1 2 3
3
2 11 20
3
11 12 13
3
10 19 28
2
100 1000
输出样例
B
B
A
A
A

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

源链接: HDU-6944

最后修改于 2021-10-23T19:10:46+00:00 由爬虫自动更新

共提交 0

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