记录编号 |
22265 |
评测结果 |
AAAAAAAAAA |
题目名称 |
扩散 |
最终得分 |
100 |
用户昵称 |
reamb |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.020 s |
提交时间 |
2010-11-18 12:09:17 |
内存使用 |
0.12 MiB |
显示代码纯文本
program kuosan;
var
n,i,j,k,mm:longint;
x,y:array[1..50]of longint;
f:array[1..50,1..50]of longint;
function max(a,b:longint):longint;
begin
if a>b then
max:=a
else
max:=b
end;
begin
assign (input,'ppg.in');
reset (input);
assign (output,'ppg.out');
rewrite (output);
readln (n);
for i:=1 to n do
readln (x[i],y[i]);
for i:=1 to n do
for j:=1 to n do
f[i,j]:=maxlongint;
for i:=1 to n do
for j:=1 to n do
if i=j then
f[i,j]:=0
else
f[i,j]:=(abs(x[i]-x[j])+abs(y[i]-y[j])-1)div 2+1;
for k:=1 to n do
for i:=1 to n do
for j:=1 to n do
if (f[i,k]<>maxlongint)and(f[k,j]<>maxlongint)then
if max(f[i,k],f[k,j])<f[i,j] then
f[i,j]:=max(f[i,k],f[k,j]);
mm:=0;
for i:=1 to n do
for j:=1 to n do
if (f[i,j]<>maxlongint)and(f[i,j]>mm) then
mm:=f[i,j];
writeln (mm);
close (input);
close (output)
end.