记录编号 | 441833 | 评测结果 | AAAAAAAAAA | ||
---|---|---|---|---|---|
题目名称 | 为爱追寻 | 最终得分 | 100 | ||
用户昵称 | 是否通过 | 通过 | |||
代码语言 | C++ | 运行时间 | 9.146 s | ||
提交时间 | 2017-08-25 17:35:19 | 内存使用 | 0.31 MiB | ||
#include<bits/stdc++.h> using namespace std; struct h{ int x,y; bool operator < (const h& a)const { if(x<a.x) return 1; if(x>a.x) return 0; if(x==a.x) { return y<a.y; } } }; int read(){ int a=0,b=1; char ch=getchar(); while(!('9'>=ch&&'0'<=ch)){ if(ch=='-'){ b=-1; } ch=getchar(); } while('9'>=ch&&'0'<=ch){ a=(a<<1)+(a<<3)+ch-'0'; ch=getchar(); } return a*b; } set<h>S; int n,x0,y,xt,yt,ans=1; int main() { freopen("loverfinding.in","r",stdin); freopen("loverfinding.out","w",stdout); // freopen("1.txt","r",stdin); scanf("%d%d%d%d%d",&n,&x0,&y,&xt,&yt); h o; o.x=x0; o.y=y; S.insert(o); for(int i=1;i<=n;i++){ int a,b; scanf("%d%d",&a,&b); h o; x0+=a; y+=b; o.x=x0; o.y=y; if(S.find(o)==S.end()){ S.insert(o); ans++; } if(x0==xt&&y==yt){ break; } } cout<<ans; return 0; }