| 比赛 | NOIP模拟赛by mzx Day1 | 评测结果 | AAAWWWWWWE | 
    | 题目名称 | 为爱追寻 | 最终得分 | 30 | 
    | 用户昵称 | 丁司令 | 运行时间 | 5.594 s | 
    | 代码语言 | C++ | 内存使用 | 19.36 MiB | 
    | 提交时间 | 2016-10-19 20:30:30 | 
显示代码纯文本
#include<cstdio>
#include<iostream>
#include<map>
using namespace std;
int n,x,y,x1,y1,h,s,sum;
bool a[5005][5005];
int main()
{
	freopen("loverfinding.in","r",stdin);
	freopen("loverfinding.out","w",stdout);
	cin>>n>>x>>y>>x1>>y1;
	x+=2501;
	y+=2501;
	x1+=2501;
	y1+=2501;
	sum=1;
	for(int i=1;i<=n;i++)
	  {
	  	scanf("%d%d",&h,&s);
	  	x+=h;
	  	y+=s;
	    if(!a[x][y]) 
	    {
	    	sum++;
	    	a[x][y]=1;
	    	if(x==x1&&y==y1) break;
	    }
	  }
	if(sum==n&&(x!=x1||y!=y1))
	cout<<"SingleDogMZX";
	else
	cout<<sum;
	fclose(stdin);
	fclose(stdout);
	return 0;
}