- 集合位置
- 2008-12-26 13:22:29 @
var f,a:array[0..1000,0..1000]of double;
n,m,i,j,k,x,y,p:longint;
l:array[0..1000]of record x,y:double;end;
b:array[0..1000]of record x,y:longint;end;
min,minf:double;
v:array[0..1000]of boolean;
begin
readln(n,m);
for i:=1 to n do read(l[i].x,l[i].y);
for i:=1 to n do for j:=1 to n do a:=maxlongint;
for i:=1 to n do a:=0;
for i:=1 to m do
begin
read(x,y);
a[x,y]:=sqrt(sqr(l[x].x-l[y].x)+sqr(l[x].y-l[y].y));
a[y,x]:=a[x,y];
end;
f:=a;
for k:=1 to n do
for i:=1 to n do
for j:=1 to n do
if f+f[k,j]f[1,j])and(f[1,j]0)then begin minf:=f[1,j];p:=j;end;
v[p]:=true;
for j:=1 to n do
if f[1,p]+f[p,j]
0 条评论
目前还没有评论...