比赛 |
NOIP模拟赛by mzx Day1 |
评测结果 |
TTTTTTTTTT |
题目名称 |
为爱追寻 |
最终得分 |
0 |
用户昵称 |
Cydiater |
运行时间 |
10.018 s |
代码语言 |
C++ |
内存使用 |
0.28 MiB |
提交时间 |
2016-10-19 19:15:17 |
显示代码纯文本
//A
//by Cydiater
//2016.10.19
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <map>
#include <ctime>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <cstring>
#include <string>
using namespace std;
#define ll long long
#define up(i,j,n) for(int i=j;i<=n;i++)
#define down(i,j,n) for(int i=j;i>=n;i--)
#define pii pair<int,int>
#define x first
#define y second
#define mp make_pair
#define FILE "loverfinding"
const int MAXN=1e6+5;
const int oo=0x3f3f3f3f;
inline int read(){
char ch=getchar();int x=0,f=1;
while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
map<pii,int>xy;
int N,stx,sty,ndx,ndy,ans=0;
namespace solution{
void slove(){
N=read();stx=read();sty=read();ndx=read();ndy=read();
xy[mp(stx,sty)]=ans=1;
if(stx==ndx&&sty==ndy){
puts("1");
return;
}
up(i,1,N){
int dx=read(),dy=read();
stx+=dx;sty+=dy;
if(xy[mp(stx,sty)]==0){
ans++;
xy[mp(stx,sty)]=1;
}
if(stx==ndx&&sty==ndy){
cout<<ans<<endl;
return;
}
}
puts("SingleDogMZX");
}
}
int main(){
freopen(FILE".in","r",stdin);
freopen(FILE".out","w",stdout);
using namespace solution;
slove();
return 0;
}