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

建议使用的浏览器:

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

6869:Slime and Stones

题目描述
Orac and Slime are playing a game.

There are two groups of stones, the first group contains $a$ stones and the second contains $b$ stones. Orac and Slime operate them by turns in the game. For each operation, they have two choices:

1. Pick up any number of stones from a certain group;

2. Pick up $x$ stones from the first group and $y$ from the second group, which $x,y$ satisfy $|x-y|\le k$. $k$ is a given constant.

Notice that not picking up any stone in an operation is not allowed. If there is no stone left in both groups at the beginning of one's turn, he loses the game.

Orac would like to know whether there exists a winning strategy for him if he operates first. They will play many times, so he will make multiple queries.
输入解释
The first line contains one integer $T$($1\le T\le 10^5$), which stands for the number of queries that Orac makes.
In the following $T$ lines, each line contains three integer $a,b,k$($1\le a\le 10^8, 1\le b\le 10^8, 0\le k\le 10^8$).
输出解释
The output contains $T$ lines, with an integer $0$ or $1$ in each line, stand for there exist/not exist a winning strategy for the given situation.
输入样例
4
1 2 0
2 4 0
1 2 1
2 6 1
输出样例
0
1
1
0

提示
In the first query, if Orac picks up all the stones from a group, Slime will pick up all the stones from the other group, and if Orac picks up a stone from the second group, Slime will pick up a stone from both groups.
来自杭电HDUOJ的附加信息
Recommend IceyWang

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

源链接: HDU-6869

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

共提交 0

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