比赛 20101118 评测结果 AAAAAAAAAA
题目名称 扩散 最终得分 100
用户昵称 苏轼 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2010-11-18 09:10:58
显示代码纯文本
program ppg(input,output);

type
  re=record
    x,y:longint;
  end;

var
  n,i,j,k,tmp:longint;
  c:array[1..50]of re;
  way:array[1..50,1..50]of longint;

function dis(const a,b:re):longint;
  var
    ans:longint;
  begin
    ans:=abs(a.x-b.x)+abs(a.y-b.y);
    if odd(ans) then
      exit(ans div 2+1)
    else
      exit(ans div 2);
  end;

begin
  assign(input,'ppg.in');
  reset(input);
  assign(output,'ppg.out');
  rewrite(output);

  readln(n);
  for i:=1 to n do
  begin
    readln(c[i].x,c[i].y);
    for j:=1 to i-1 do
    begin
      way[i,j]:=dis(c[i],c[j]);
      way[j,i]:=way[i,j];
    end;
  end;

  for k:=1 to n do
    for i:=1 to n do
      for j:=1 to n do
      begin
        if way[i,k]>way[k,j] then
          tmp:=way[i,k]
        else
          tmp:=way[k,j];

        if tmp<way[i,j] then
        begin
          way[i,j]:=tmp;
          way[j,i]:=tmp;
        end;
      end;

  tmp:=0;
  for i:=1 to n do
    for j:=1 to n do
      if way[i,j]>tmp then
        tmp:=way[i,j];

  writeln(tmp);

  close(input);
  close(output);
end.