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

建议使用的浏览器:

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

5708:Alice and Bob

题目描述
Alice and Bob are playing a stone game in a board of $n\times m$ cells.

In the begining, the stone is in the upperleft cell. And in each turn, they can move the stone one cell to the right or one cell down, or diagonally $k$ cells down to the right, which means if you are at $(x,y)$, then you could move into $(x+1,y)$, $(x,y+1)$ or $(x+k,y+k)$ at the next step. The player who can not move loses. They play in turns and Alice moves first.

Now given $n$, $m$ and $k$, could you tell me who is the winner?
输入解释
First line contains an integer $T(1\leq T\leq 10)$, denoting the number of test cases.

In each test case, the first line is two integers $Q$ and $k$.
In the following $Q$ lines, each line contains $n$ and $m$.$(1\leq Q\leq 1000,1\leq k,n,m\leq 10^9)$
输出解释
For each test case, output $Q$ lines.
If Alice is the winner, output ``Alice''. Otherwise ``Bob''.
输入样例
2
2 1
4 5
3 4
2 3
4 5
5 6
输出样例
Alice
Alice
Alice
Bob
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-5708

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

共提交 0

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