比赛 NOIP模拟赛by mzx Day1 评测结果 EEEEEEEEEE
题目名称 为爱追寻 最终得分 0
用户昵称 燕哥到此一游 运行时间 0.022 s
代码语言 Pascal 内存使用 24.02 MiB
提交时间 2016-10-19 20:30:46
显示代码纯文本
program fuckyouonce;
var
  k,i,j,n,x,y,x0,y0,xt,yt,ans:longint;
  a:array[-2500..2500,-2500..2500] of boolean;
  fin,fout:text;
begin
  assign(fin,'loverfinding.in');
  assign(fout,'loverfinding.out');
  reset(fin);
  rewrite(fout);
  fillchar(a,sizeof(a),false);
  readln(fin,n,x0,y0,xt,yt);
  a[x0,y0]:=true;
  ans:=1;
  for k:=1 to n do
    begin
      readln(fin,x,y);
      x0:=x0+x;
      y0:=y0+y;
      if (not a[x0,y0]) then
        begin
          a[x0,y0]:=true;
          ans:=ans+1;
          if (x0=xt) and (y0=yt) then
            begin
              writeln(fout,ans);
              close(fin);
              close(fout);
              halt;
            end;
        end;
    end;
  writeln(fout,'SingleDogMZX');
  close(fin);
  close(fout);
end.