记录编号 |
418412 |
评测结果 |
AAAAAAAAAA |
题目名称 |
为爱追寻 |
最终得分 |
100 |
用户昵称 |
玉带林中挂 |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
3.187 s |
提交时间 |
2017-06-30 10:48:13 |
内存使用 |
0.31 MiB |
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cstring>
using namespace std;
typedef pair<int,int>xy;
vector<xy>vis;
xy now,temp1,temp2;
int n,now_x,now_y,xx,yy,dx,dy,ans;
int main()
{
freopen("loverfinding.in","r",stdin);
freopen("loverfinding.out","w",stdout);
scanf("%d%d%d%d%d",&n,&now.first,&now.second,&xx,&yy);
vis.push_back(now);
for(int i=1;i<=n;i++)
{
scanf("%d%d",&dx,&dy);
now.first+=dx;
now.second+=dy;
vis.push_back(now);
if(now.first==xx&&now.second==yy)
{
sort(vis.begin(),vis.end());
for(int i=0;i<vis.size();i++)
{
if(!i||vis[i]!=vis[i-1])ans++;
}
printf("%d\n",ans);
return 0;
}
}
printf("SingleDogMZX\n");
fclose(stdin);fclose(stdout);
return 0;
}