记录编号 |
22278 |
评测结果 |
AAAAAAAAAA |
题目名称 |
扩散 |
最终得分 |
100 |
用户昵称 |
ybh |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.016 s |
提交时间 |
2010-11-18 14:29:20 |
内存使用 |
0.12 MiB |
显示代码纯文本
{扩散 NOIP模拟2010-11-18
Author: yangbohua
Time: 2010-11-18}
program ppg;
var
x,y:array[0..50] of longint;
map:array[0..50,0..50] of longint;
n,i,j,k:longint;
ans,temp: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-1 do
for j:=i+1 to n do
begin
temp:=(abs(x[i]-x[j])+abs(y[i]-y[j])-1) div 2 +1;
map[i,j]:=temp;
map[j,i]:=temp;
end;
for k:=1 to n do
for i:=1 to n do
for j:=1 to n do
if max(map[i,k],map[k,j])<map[i,j]
then map[i,j]:=max(map[i,k],map[k,j]);
ans:=0;
for i:=1 to n-1 do
for j:=i+1 to n do
if map[i,j]>ans
then ans:=map[i,j];
writeln(ans);
close(input);
close(output);
end.