记录编号 326610 评测结果 TTTTTTTTTT
题目名称 为爱追寻 最终得分 0
用户昵称 Gravatarciyou 是否通过 未通过
代码语言 C++ 运行时间 10.008 s
提交时间 2016-10-21 11:03:33 内存使用 0.31 MiB
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
#include<set>
using namespace std;
int n,x,y,xt,yt,ans=1;
struct movement{
    int x, y;
    bool operator < (const movement& c) const{
        if(x>c.x) return true;
        if(x<c.x) return false;
        else return y>c.y;
    }
    bool operator = (const movement& c) const{
        return x==c.x&&y==c.y;
    }
};
set<movement> checked;
movement make(int x,int y){
    movement t;
    t.x=x;
    t.y=y;
    return t;
}
int main(){
    freopen("loverfinding.in","r",stdin);
    freopen("loverfinding.out","w",stdout);
    scanf("%d%d%d%d%d",&n,&x,&y,&xt,&yt);
    checked.insert(make(x,y));
    for(int i=1;i<=n;i++){
        int a,b;
        scanf("%d%d",&a,&b);
        x+=a;
        y+=b;
        checked.insert(make(x,y));
        if(x==xt&&y==yt){
            cout<<checked.size();
            fclose(stdin);
            fclose(stdout);
            return 0;
        }
    }
    printf("SingleDogMZX");
    fclose(stdin);
    fclose(stdout);
    return 0;
}