比赛 |
NOIP模拟赛by mzx Day1 |
评测结果 |
WWWWWWWWWW |
题目名称 |
为爱追寻 |
最终得分 |
0 |
用户昵称 |
GROWL GOOD BOYส็ |
运行时间 |
0.279 s |
代码语言 |
C++ |
内存使用 |
0.22 MiB |
提交时间 |
2016-10-19 19:50:15 |
显示代码纯文本
- #include<cstdio>
- #include<cstring>
- #include<iostream>
- #include<algorithm>
- #include<set>
- #include<ctime>
-
- using namespace std;
-
-
- int N,Ans=1;
-
- int SX,SY,TX,TY;
-
- struct node
- {
- int x,y;
- bool operator == (const node &a)const
- {
- return (a.x==x&&a.y==y);
- }
- bool operator <(const node &a)const
- {
- if(a.x!=x)return a.x<x;
- return a.y<y;
- }
-
- }ha;
-
- set<node> p;
-
- int main()
- {
- freopen("loverfinding.in","r",stdin);
- freopen("loverfinding.out","w",stdout);
- scanf("%d%d%d%d%d",&N,&SX,&SY,&TX,&TY);
- ha.x=SX,ha.y=SY;
- for(int x,y,i=1;i<=N;i++)
- {
-
- scanf("%d%d",&x,&y);
- SX+=x;
- SY+=y;
- //printf("i== %d %d %d\n",i,SX,SY);
- ha.x=SX,ha.y=SY;
- set<node> :: iterator it=p.lower_bound(ha);
- if(it!=p.end()&&*it==ha)Ans=Ans;
- else Ans++,p.insert(ha);
- if(SX==TX&&SY==TY)
- {
- printf("%d",Ans);
- return 0;
- }
- if(clock()>450)
- {
- printf("SingleDogMZX");
- return 0;
- }
- }
- printf("SingleDogMZX");
- // printf("\n time used %lf",clock()/1000.0);
- return 0;
- }