记录编号 | 327471 | 评测结果 | AAAAAAAAAA | ||
---|---|---|---|---|---|
题目名称 | 为爱追寻 | 最终得分 | 100 | ||
用户昵称 | 是否通过 | 通过 | |||
代码语言 | C++ | 运行时间 | 5.241 s | ||
提交时间 | 2016-10-22 07:30:30 | 内存使用 | 6.35 MiB | ||
#include<iostream> #include<cstdio> #include<algorithm> #define MAXN 1000001 #define M 2000000000 #define LL long long using namespace std; LL sx,sy,tx,ty,n,tot; struct data{int x,y;}u; bool flag; LL s[MAXN]; int read() { int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9') {if(ch=='-') f=-1;ch=getchar();} while(ch>='0'&&ch<='9') x=x*10+ch-48,ch=getchar(); return x*f; } int main() { freopen("loverfinding.in","r",stdin); freopen("loverfinding.out","w",stdout); int x,y,xx,yy; n=read(),sx=read(),sy=read(),tx=read(),ty=read(); s[++tot]=(sx-1)*M+sy; for(int i=1;i<=n;i++) { x=read(),y=read(); sx+=x,sy+=y; s[++tot]=(sx-1)*M+sy; if(sx==tx&&sy==ty) { flag=true; break; } } if(flag) { sort(s+1,s+tot+1); tot=unique(s+1,s+tot+1)-s-1; printf("%d",tot); } else printf("SingleDogMZX"); return 0; }