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

建议使用的浏览器:

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

7061:GCD Game

题目描述
Alice and Bob are playing a game.

They take turns to operate. There are $n$ numbers, $a_1$ , $a_2$ , ... , $a_n$. Every time, the player plays in 3 steps.
1.Arbitrarily chooses one number $a_i$.
2.Arbitrarily chooses another number $x$($1 \leq x < a_i$).
3. Replace the number $a_i$ with $gcd(a_i,x)$. Here, $gcd(u,v)$ refers to the $\textbf{Greatest Common Divisor}$ of $u$ and $v$.

When a player can not make a single move he/she loses the game. Alice moves the first and she asks you to tell her who will win the game if both player play optimally.
输入解释
The first line contains a number $T$($1 \leq T \leq 100$), the number of testcases.

For each testcase, there are two lines.
The first line contains one number $n$($1 \leq n \leq 10^6$).
The second line contains $n$ numbers $a_1$ , $a_2$ , ... , $a_n$($1 \leq a_i \leq 10^7$).

It is guaranteed that for all testcases, $\sum{n} \leq 10^6$.
输出解释
For each testcase, output the answer in one line. If Alice will win the game, print "Alice", otherwise print "Bob".
输入样例
2
1
1
1
2
输出样例
Bob
Alice

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

源链接: HDU-7061

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

共提交 0

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