| 比赛 | NOIP模拟赛by mzx Day1 | 评测结果 | TTTTTTTTTT | 
    | 题目名称 | 为爱追寻 | 最终得分 | 0 | 
    | 用户昵称 | MistyEye | 运行时间 | 10.006 s | 
    | 代码语言 | C++ | 内存使用 | 0.31 MiB | 
    | 提交时间 | 2016-10-19 20:31:34 | 
显示代码纯文本
#include <cstdio>
#include <cstring>
#include <set>
#include <ctime>
#include <string>
using namespace std;
typedef long long ll;
inline int read(){
    int x=0,f=1; char ch;
    while(ch=getchar(), !isdigit(ch)) if(ch=='-') f = -1;
    x = ch-'0';
    while(ch=getchar(), isdigit(ch)) x = x*10+ch-'0';
    return x*f;
}
set<pair<int, int> > ma;
int N, sx, sy, tx, ty, ans;
int main(){
	freopen("lovefinding.in","r",stdin);
	freopen("lovefinding.out","w",stdout);
	N = read(), sx = read(), sy = read(), tx = read(), ty = read();
	ma.insert(make_pair(sx, sy));
	++ans;
	for(int i=1; i<=N; ++i) {
		sx += read(), sy += read();
		if(ma.count(make_pair(sx, sy))) continue;
		ma.insert(make_pair(sx, sy));
		++ans;
		if(sx==tx && sy==ty) break;		
	}
	if(sx==tx && sy==ty) printf("%d\n", ans);
	else puts("SingleDogMZX");
	// printf("%d\n", (int)clock());
	// while(1);
	return 0;
}