比赛 模拟训练 评测结果 TTTTTTTTTT
题目名称 零食店 最终得分 0
用户昵称 皓芷 运行时间 10.000 s
代码语言 C++ 内存使用 0.31 MiB
提交时间 2017-06-15 20:17:24
显示代码纯文本
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#define mysister
#define maxn
using namespace std;
int n,x[2],y[2],ans=1,zx,zy;
struct desk
{
	int x,y;
	bool operator < (const desk b)const
	{
		return x==b.x?y<b.y:x<b.x;
	}
};
inline void in(int &x)
{
    x=0;int f=1;char t=getchar();
    while(!isdigit(t)){if(t=='-')f=-1;t=getchar();}
    while(isdigit(t)){x=x*10+t-48;t=getchar();}
    x*=f;
}
vector<desk>d;
int main()
{
	freopen("loverfinding.in","r",stdin);
	freopen("loverfinding.out","w",stdout);
//	scanf("%d%d%d%d%d",&n,&x[0],&y[0],&x[1],&y[1]);
	in(n);in(x[0]);in(y[0]);in(x[1]);in(y[1]);
	  desk zz;
	  zz.x=x[0];
	  zz.y=y[0];
	  d.push_back(zz);
	if(x[0]==x[1]&&y[0]==y[1]){printf("%d",ans);return 0;}
	while(n--)
	{
//	  scanf("%d%d",&zx,&zy);
	  in(zx);in(zy);
	  x[0]=x[0]+zx;
	  y[0]=y[0]+zy;
	  desk zz;
	  zz.x=x[0];
	  zz.y=y[0];
	  d.push_back(zz);
	  if(x[0]==x[1]&&y[0]==y[1]){ans=0;break;}
	}
	if(ans)printf("SingleDogMZX");
	else
	{
	  n=d.size();
	  sort(d.begin(),d.end());
	  for(int i=0;i<n;i++)
	  {
	  	while(d[i].x==d[i+1].x&&d[i].y==d[i+1].y)i++;
	  	ans++;
	  }
	  printf("%d",ans);
	}
	return 0;
}