CF69D.Dot
普及+/提高
通过率:0%
时间限制:3.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Anton and Dasha like to play different games during breaks on checkered paper. By the 11th grade they managed to play all the games of this type and asked Vova the programmer to come up with a new game. Vova suggested to them to play a game under the code name "dot" with the following rules:
- On the checkered paper a coordinate system is drawn. A dot is initially put in the position (x, y).
- A move is shifting a dot to one of the pre-selected vectors. Also each player can once per game symmetrically reflect a dot relatively to the line y = x.
- Anton and Dasha take turns. Anton goes first.
- The player after whose move the distance from the dot to the coordinates' origin exceeds d, loses.
Help them to determine the winner.
安东和达莎喜欢在方格纸上休息时玩各种游戏。到11年级时,他们已经玩遍了所有这类游戏,于是请程序员沃瓦设计一个新游戏。沃瓦为他们提出了一个代号为“点”的游戏,规则如下:
- 在方格纸上绘制一个坐标系,初始时在位置 (x,y) 处放置一个点;
- 每次移动是将该点沿某个预先选定的向量平移;此外,每位玩家在整个游戏中至多可使用一次关于直线 y=x 的对称反射操作(即以该直线为对称轴,将点反射到对称位置);
- 安东和达莎轮流进行操作,安东先手;
- 若某位玩家完成操作后,该点到坐标原点的距离超过 d,则该玩家判负。
请帮助他们判断谁将获胜。
输入格式
The first line of the input file contains 4 integers x, y, n, d ( - 200 ≤ x, y ≤ 200, 1 ≤ d ≤ 200, 1 ≤ n ≤ 20) — the initial coordinates of the dot, the distance d and the number of vectors. It is guaranteed that the initial dot is at the distance less than d from the origin of the coordinates. The following n lines each contain two non-negative numbers x__i and y__i (0 ≤ x__i, y__i ≤ 200) — the coordinates of the i-th vector. It is guaranteed that all the vectors are nonzero and different.
输入文件的第一行包含 4 个整数 x、y、n、d(−200≤x,y≤200,1≤d≤200,1≤n≤20)—— 分别表示点的初始坐标、距离 d 以及向量的个数。保证初始点到坐标原点的距离小于 d。接下来的 n 行,每行包含两个非负数 xi 和 yi(0≤xi,yi≤200)—— 表示第 i 个向量的坐标。保证所有向量均为非零向量且互不相同。
输出格式
You should print "Anton", if the winner is Anton in case of both players play the game optimally, and "Dasha" otherwise.
如果双方都以最优策略进行游戏,且获胜者为安东,则输出 “Anton”;否则输出 “Dasha”。
输入输出样例
输入#1
0 0 2 3 1 1 1 2
输出#1
Anton
输入#2
0 0 2 4 1 1 1 2
输出#2
Dasha
说明/提示
In the first test, Anton goes to the vector (1;2), and Dasha loses. In the second test Dasha with her first move shifts the dot so that its coordinates are (2;3), and Anton loses, as he has the only possible move — to reflect relatively to the line y = x. Dasha will respond to it with the same move and return the dot in position (2;3).
在第一个测试中,安东移动到向量 (1;2),达莎输掉比赛。在第二个测试中,达莎通过她的第一步将点移动至坐标 (2;3),安东输掉比赛,因为他唯一可能的走法是关于直线 y=x 进行反射。达莎将用相同的走法回应,并将点恢复至位置 (2;3)。
输入解题思路,AI测评打分。不知道怎么写?