比赛 NOIP模拟赛by mzx Day1 评测结果 TTTTTTTTTT
题目名称 为爱追寻 最终得分 0
用户昵称 KZNS 运行时间 10.016 s
代码语言 C++ 内存使用 0.31 MiB
提交时间 2016-10-19 19:29:54
显示代码纯文本
//KZNS
#include <cstdio>
#include <set>
#include <utility>
using namespace std;
typedef pair<int, int> pr;
set<pr> st;
int input() {
    int f = 1;
    int a = 0;
    char c = getchar();
    while (!(c == '-' || ('0' <= c && c <= '9')))
        c = getchar();
    if (c == '-') {
        f = -1;
        c = getchar();
    }
    while ('0' <= c && c <= '9') {
        a = a * 10 + c - '0';
        c = getchar();
    }
    return a * f;
}
int main() {
    freopen("loverfinding.in", "r", stdin);
    freopen("loverfinding.out", "w", stdout);
    int N;
    int x, y, xt, yt;
    int a, b;
    scanf("%d %d %d %d %d", &N, &x, &y, &xt, &yt);
    if (x == xt && y == yt) {
        printf("1\n");
        return 0;
    }
    st.insert(make_pair(x, y));
    for (int i = 0; i < N; i++) {
        a = input();
        b = input();
        x += a;
        y += b;
        st.insert(make_pair(x, y));
        if (x == xt && y == yt) {
            printf("%d\n", (int)(st.size()));
            return 0;
        } 
    }
    printf("SingleDogMZX\n");
    return 0;
}
//UBWH