A8153 | Dot
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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.
- 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.
输入格式
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.
输出格式
You should print "Anton", if the winner is Anton in case of both players play the game optimally, and "Dasha" otherwise.
输入输出样例
输入 #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).
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted