比赛 NOIP模拟赛by mzx Day1 评测结果 TTTTTTTTTT
题目名称 为爱追寻 最终得分 0
用户昵称 抽空的太阳 运行时间 10.006 s
代码语言 C++ 内存使用 68.95 MiB
提交时间 2016-10-19 20:58:55
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<algorithm>
#define lon long long
using namespace std;
const int maxn=10000010;
lon n,x0,y0,xt,yt,tot,a[maxn];
bool flag;
lon init()
{
	lon f=1,x=0;char c=getchar();
	while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	return f*x;
}
int main()
{
	freopen("loverfinding.in","r",stdin);
	freopen("loverfinding.out","w",stdout);
	lon x,y,s;
	n=init();x0=init();y0=init();xt=init();yt=init();
	a[++tot]=(x0-1)*maxn+y0;
	for(int i=1;i<=n;i++)
	{
		x=init();y=init();
		x0=x0+x;y0=y0+y;
		s=(x0-1)*maxn+y0;
		a[++tot]=s;
		if(x0==xt&&y0==yt)
		{
			flag=1;
			break;
		}
	}
	if(flag)
	{
		sort(a+1,a+tot+1);
		int ans=unique(a+1,a+tot+1)-a-1;
		cout<<ans;
		return 0;
	}
	cout<<"SingleDogMZX";
	return 0;
}