比赛 NOIP模拟赛by mzx Day1 评测结果 TTTTTTTTTT
题目名称 为爱追寻 最终得分 0
用户昵称 YGOI_真神名曰驴蛋蛋 运行时间 10.008 s
代码语言 C++ 内存使用 0.27 MiB
提交时间 2016-10-19 20:25:44
显示代码纯文本
#include <map>
#include <cstdio>
using std::map;
typedef int TYPE;
typedef std::pair<TYPE,TYPE> PAIR;
void read(TYPE&k){
	static int c,t;t=1;k=0;
	do{c=getchar();}while((c<'0'||c>'9')&&c!='-');
	if(c=='-')t=-1,c=getchar();
	do{k=k*10+c-'0';c=getchar();}while(c>='0'&&c<='9');k=k*t;
}
map<PAIR,bool>mp;
int main(){
	freopen("loverfinding.in","r",stdin);
	freopen("loverfinding.out","w",stdout);
	TYPE N,x0,y0,x1,y1,xx,yy,cnt=0;
	bool judge=false;
	read(N);read(x0);read(y0);read(x1);read(y1);
	//scanf("%lld%lld%lld%lld",&x0,&y0,&x1,&y1);
	if(x0==x1&&y0==y1){printf("1");return 0;}
	for(TYPE i=1;i<=N;++i){
		read(xx);read(yy);
		//scanf("%lld%lld",&xx,&yy);
		if(x0==x1&&y0==y1){judge=true;break;}
		x0+=xx;y0+=yy;
		if(mp.count(PAIR(x0,x1))==0)++cnt;
		mp[PAIR(x0,y0)]=true;
	}if(judge==false)printf("SingleDogMZX");
	else printf("%d",cnt);
	fclose(stdin);fclose(stdout);
	return 0;
}