比赛 |
NOIP模拟赛by mzx Day1 |
评测结果 |
TTTTTTTTTT |
题目名称 |
为爱追寻 |
最终得分 |
0 |
用户昵称 |
_Itachi |
运行时间 |
10.010 s |
代码语言 |
C++ |
内存使用 |
0.27 MiB |
提交时间 |
2016-10-19 21:48:09 |
显示代码纯文本
#include<cstdio>
#include<cstring>
#include<cctype>
#include<algorithm>
#include<map>
using namespace std;
int _read(){int ret,neg;char ch;ret=neg=0;while(!isdigit(ch=getchar())&&ch!='-');if(ch=='-')neg=1,ch=getchar();while(ret=ret*10+ch-'0',isdigit(ch=getchar()));if(neg)ret=-ret;return ret;}
struct _q{
int x,y;
bool operator < (const _q &a)const{
return x==a.x?y<a.y:x<a.x;
}
}rt;map<_q,bool>q;
int n,x0,y0,xt,yt;
void _work(){
//scanf("%d%d%d%d%d",&n,&x0,&y0,&xt,&yt);
n=_read(),x0=_read(),y0=_read(),xt=_read(),yt=_read();
int i,x,y,ans=1;rt=(_q){x0,y0};q[rt]=true;
while(n--){
//scanf("%d%d",&x,&y);
x=_read(),y=_read();
rt.x+=x,rt.y+=y;
if(q.count(rt)==0)ans++,q[rt]=true;
if(rt.x==xt&&rt.y==yt){
printf("%d\n",ans);return;
}
}
puts("SingleDogMZX");
}
bool _Rabit(),_RABIT=_Rabit();int main(){;}
bool _Rabit(){
#define _Rabit _RABIT
#ifdef _Rabit
freopen("loverfinding.in","r",stdin);
freopen("loverfinding.out","w",stdout);
#endif
_work();
#ifndef _Rabit
getchar(),getchar();
#endif
fclose(stdin);fclose(stdout);
}