| 比赛 | NOIP模拟赛by mzx Day1 | 评测结果 | TTTTTTTTTT | 
    | 题目名称 | 为爱追寻 | 最终得分 | 0 | 
    | 用户昵称 | kito | 运行时间 | 10.020 s | 
    | 代码语言 | C++ | 内存使用 | 0.21 MiB | 
    | 提交时间 | 2016-10-19 21:45:58 | 
显示代码纯文本
#include<cstdio>
#include<set>
using namespace std;
#define	fcl	fclose(stdin);	fclose(stdout);	return 0
	#define	SUBMIT
/*
	stl set 
*/ 
	
struct ss{
	int x,y;
	ss(const int& a,const int& b){
		x=a;	y=b;
	}
	bool operator < (const ss& a) const{
		if(x!=a.x)	return x<a.x;
		else	return y<a.y;
	}
}v(0,0);
set<ss> S;
int n,x0,y0,x1,y1,cnt;
inline int GetMax(const int& a,const int& b){
	if(a>b)	return a;
	return b;
}
inline int GetMin(const int& a,const int& b){
	if(a<b)	return a;
	return b;
}
int main(){
	#ifdef SUBMIT
	freopen("loverfinding.in","r",stdin);
	freopen("loverfinding.out","w",stdout);
	#endif
	scanf("%d%d%d%d%d",&n,&x0,&y0,&x1,&y1);
	int a,b;
	int ans=1;
	if(x0==x1&&y0==y1){
		printf("1\n");
		#ifndef SUBMIT
		getchar();	getchar();
		#endif
		fcl;
	}
	S.insert(ss(x0,y0));
	for(int i=1;i<=n;++i){
		scanf("%d%d",&a,&b);
		x0+=a;	y0+=b;
		v=ss(x0,y0);
		if(!S.count(v)){
			ans++;
			S.insert(v);
			if(x0==x1&&y0==y1){
				printf("%d",ans);
				#ifndef SUBMIT
				getchar();	getchar();
				#endif
				fcl;
			}
		}
	}
	printf("SingleDogMZX");
	#ifndef SUBMIT
	getchar();	getchar();
	#endif
	fcl;
}