记录编号 |
22317 |
评测结果 |
AAAAAAAAAA |
题目名称 |
扩散 |
最终得分 |
100 |
用户昵称 |
nick09 |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.018 s |
提交时间 |
2010-11-18 15:56:26 |
内存使用 |
0.12 MiB |
显示代码纯文本
var n,i,j,k,s:longint;
x,y:array[0..51]of longint;
tot:int64;
g:array[0..51]of boolean;
t:array[0..51,0..51]of boolean;
f:array[0..51,0..51]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]);
fillchar(g,sizeof(g),false);
fillchar(t,sizeof(t),false);
if n=1 then begin writeln('0');close(input);close(output);halt; end;
for i:=1 to n-1 do
for j:=i+1 to n do
begin
if x[i]>x[j] then begin
k:=x[i];x[i]:=x[j];x[j]:=k;
k:=y[i];y[i]:=y[j];y[j]:=k;
end;
end;
for i:=1 to n do
for j:=1 to n do
begin
if i=j then f[i,j]:=0;
if i<>j then
begin
s:=abs(x[i]-x[j])+abs(y[i]-y[j]);
if s mod 2 =1 then inc(s);
f[i,j]:=s div 2;
end;
end;
tot:=0;
if n=2 then begin writeln(f[1,2]);close(input);close(output); end;
if n>2 then begin
for k:=1 to n do
for i:=1 to n do
for j:=1 to n do
if (k<>i )and(k<>j)and(i<>j) then
begin
if (f[i,j]>max(f[i,k],f[k,j]))then
f[i,j]:=max(f[k,j],f[i,k]);
end;
tot:=0;
for i:=1 to n do
for j:=1 to n do
if f[i,j]>tot then tot:=f[i,j];
writeln(tot);
close(input);close(output);
end;
end.