比赛 |
NOIP模拟赛by mzx Day1 |
评测结果 |
TTTTTTTTTT |
题目名称 |
为爱追寻 |
最终得分 |
0 |
用户昵称 |
ミント |
运行时间 |
10.026 s |
代码语言 |
C++ |
内存使用 |
0.28 MiB |
提交时间 |
2016-10-19 20:39:22 |
显示代码纯文本
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <set>
#define is_cha(x) ((x <= 'z' and x >= 'a') or (x <= 'Z' and x >= 'A'))
#define is_sym(x) ( x == '.' or x == ':' or x == ' ')
#define is_ch(x) (is_sym(x) or is_cha(x))
#define is_num(x) ((x <= '9' and x >= '0') or (x == '-'))
using namespace std;
typedef pair<int, int> P;
set<P> s;
inline int read(){
bool flag = false;
int ret = 0;
char ch = getchar();
while (!is_num(ch))ch = getchar();
if (ch=='-') {
flag = true;
ch = getchar();
}
while (is_num(ch)) {
int num = ch - '0';ret = ret * 10 + num;
ch = getchar();
}
return (flag?(-ret):(ret));
}
int main(){
freopen("loverfinding.in", "r", stdin);
freopen("loverfinding.out", "w", stdout);
int n, x0, y0, xt, yt;
n = read();
x0 = read();
y0 = read();
xt = read();
yt = read();
//cin>>n;
//cin>>x0>>y0;cin>>xt>>yt;
s.insert(make_pair(x0, y0));
if(x0==xt&&y0==yt){
cout<<1<<endl;return 0;
}
bool flag = false;
while(n--){
int dx, dy;//cin>>dx>>dy;
dx = read();
dy = read();
x0 += dx;y0 += dy;
if(x0==xt&&y0==yt){
flag = true;
break;
}s.insert(make_pair(x0, y0));
//cout<<x0<<' '<<y0<<endl;cout<<s.size()<<endl;
}
//P tmp;tmp = make_pair(xt, yt);
//if(*s.find(tmp)!=*s.end())cout<<s.size()<<endl;
if(flag) cout<<s.size()+1<<endl;
else cout<<"SingleDogMZX"<<endl;
return 0;
}