题意:
题意就是给你一些向量,再给你一个起点,两个人轮流选择一个向量,用来
改变当前点到起点的距离,两个人各有一次机会将当前位置通过
y=x这条线对称过去。谁在距离起点超过k的地方移动了点,那么就算输。
问你最后谁赢。
这是比较典型的博弈,只要有人先到超过k的地方,肯定是赢的,
因为对称这个操作双方都有,会抵消,没有影响。所以我们只需要根据先手必胜和必败的条件搜索即可。具体看代码;=。
代码:
//
// Created by CQU_CST_WuErli
// Copyright (c) 2015 CQU_CST_WuErli. All rights reserved.
//
// #include<bits/stdc++.h>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <algorithm>
#include <sstream>
#define CLR(x) memset(x,0,sizeof(x))
#define OFF(x) memset(x,-1,sizeof(x))
#define MEM(x,a) memset((x),(a),sizeof(x))
#define For_UVa if (kase!=1) cout << endl
#define BUG cout << "I am here" << endl
#define lookln(x) cout << #x << "=" << x << endl
#define SI(a) scanf("%d",&a)
#define SII(a,b) scanf("%d%d",&a,&b)
#define SIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define rep(flag,start,end) for(int flag=start;flag<=end;flag++)
#define Rep(flag,start,end) for(int flag=start;flag>=end;flag--)
#define Lson l,mid,rt<<1
#define Rson mid+1,r,rt<<1|1
#define Root 1,n,1
#define BigInteger bign
template <typename T> T gcd(const T& a,const T& b) {return b==0?a:gcd(b,a%b);}
const int MAX_L=2005;// For BigInteger
const int INF_INT=0x3f3f3f3f;
const long long INF_LL=0x7fffffff;
const int MOD=1e9+7;
const double eps=1e-9;
const double pi=acos(-1);
typedef long long ll;
using namespace std;
int x,y;
int n,d;
int dp[1000][1000];
struct P{
int x,y;
};
P p[22];
int dfs(int xx,int yy) {
if (dp[xx][yy]!=-1) return dp[xx][yy];
if ((xx-200)*(xx-200)+(yy-200)*(yy-200)>=d*d) return 1;
int &ret=dp[xx][yy];
rep(i,1,n) {
if (!dfs(xx+p[i].x,yy+p[i].y)) return ret=1;
}
return ret=0;
}
int main(){
#ifdef LOCAL
freopen("C:\\Users\\john\\Desktop\\in.txt","r",stdin);
// freopen("C:\\Users\\john\\Desktop\\out.txt","w",stdout);
#endif
while (SII(x,y)==2) {
x+=200;
y+=200;
SII(n,d);
rep(i,1,n) {
cin >> p[i].x >> p[i].y;
}
OFF(dp);
// dp[x][y]=0;
if (dfs(x,y)) cout << "Anton" << endl;
else cout << "Dasha" << endl;
}
return 0;
}