比赛 |
NOIP模拟赛by mzx Day1 |
评测结果 |
TTTTTTTTTT |
题目名称 |
为爱追寻 |
最终得分 |
0 |
用户昵称 |
Sky_miner |
运行时间 |
10.034 s |
代码语言 |
C++ |
内存使用 |
0.31 MiB |
提交时间 |
2016-10-19 19:16:48 |
显示代码纯文本
#include <map>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
inline void read(int &x){
x=0;char ch;bool flag = false;
while(ch=getchar(),ch<'!');if(ch == '-') ch=getchar(),flag = true;
while(x=10*x+ch-'0',ch=getchar(),ch>'!');if(flag) x=-x;
}
inline int cat_max(const int &a,const int &b){return a>b ? a:b;}
inline int cat_min(const int &a,const int &b){return a<b ? a:b;}
const int maxn = 1000010;
const int base = 3000;
typedef pair<int,int> cat;
map<cat,int>ma;
int ans = 0;
int main(){
freopen("loverfinding.in","r",stdin);
freopen("loverfinding.out","w",stdout);
int n,sx,sy,ex,ey;read(n);read(sx);read(sy);read(ex);read(ey);
//sx += base;sy += base;ex += base;ey += base;
int dx,dy;
++ans;
ma[make_pair(sx,sy)] = 1;
bool flag = false;
while(n--){
read(dx);read(dy);
sx += dx;sy += dy;
if(sx == ex && sy == ey){++ans;flag = true;break;};
if(ma[make_pair(sx,sy)] == 1) continue;
++ans;ma[make_pair(sx,sy)] = true;
}
if(flag) printf("%d\n",ans);
else printf("SingleDogMZX\n");
getchar();getchar();
fclose(stdin);fclose(stdout);
return 0;
}