比赛 模拟训练 评测结果 AAAAAAAAAA
题目名称 为爱追寻 最终得分 100
用户昵称 FFF团 运行时间 3.186 s
代码语言 C++ 内存使用 0.31 MiB
提交时间 2017-06-17 18:11:17
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<vector>
#include<bits/stdc++.h>
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);
	//cout<<"||"<<now.first<<" "<<now.second<<endl;
	for(int i=1;i<=n;i++){
		scanf("%d%d",&dx,&dy);
		now.first+=dx;
		now.second+=dy;
		//cout<<"||"<<now.first<<" "<<now.second<<endl;
		vis.push_back(now);
		if(now.first==xx&&now.second==yy){
			sort(vis.begin(),vis.end());
			for(int i=0;i<vis.size();i++){
				//printf("&&|%d-%d|\n",vis[i].first,vis[i].second);
				if(!i||vis[i]!=vis[i-1])ans++;
				//if(!i){
				//	ans++;
				//	continue;
				//}
				//temp1=vis[i];
				//temp2=vis[i-1];
				//printf("|%d-%d|\n",temp1.first,temp1.second);
				//if(temp1.first!=temp2.first||temp1.second!=temp2.second)ans++;
				
			}
			printf("%d\n",ans);
			return 0;
		}
	}
	printf("SingleDogMZX\n");
	return 0;
}