比赛 |
NOIP模拟赛by mzx Day1 |
评测结果 |
TTTTTTTTTT |
题目名称 |
为爱追寻 |
最终得分 |
0 |
用户昵称 |
Yuri |
运行时间 |
10.007 s |
代码语言 |
C++ |
内存使用 |
7.13 MiB |
提交时间 |
2016-10-19 19:47:08 |
显示代码纯文本
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define cg ch=getchar()
#define maxn 1000010
struct node{
int x, y;
}no[maxn];
bool cmp(node a,node b){
if(a.x == a.x) return a.y < b.y;
return a.x < b.x;
}
int read(){
int res = 0,f = 1;char ch = getchar();
while(ch < '0' || ch > '9'){if(ch == '-') f = -1;cg;}
while(ch >= '0' && ch <= '9'){res = res*10+ch-'0';cg;}
return res*f;
}
int main(){
freopen("loverfinding.in","r",stdin);
freopen("loverfinding.out","w",stdout);
// freopen("zj.out","w",stdout);
int n = read();
int sx = read(), sy = read();
int tx = read(), ty = read();
no[0].x = sx;no[0].y = sy;
int ck = -1;
for(int i = 1,a,b;i <= n;i ++){
a = read();b = read();
no[i].x = no[i-1].x+a;
no[i].y = no[i-1].y+b;
if(no[i].x == tx && no[i].y == ty){
ck = i;break;
}
}
if(ck == -1){
puts("SingleDogMZX");
return 0;
}
sort(no, no+1+ck, cmp);
int ans = 1;
for(int i = 1;i <= ck;i ++){
if(no[i].x == no[i-1].x && no[i].y == no[i-1].y) continue;
ans++;
}
printf("%d\n",ans);
getchar();getchar();
return 0;
}