- 想越狱的小杉
- 2009-07-26 10:59:30 @
var
a:array[0..2000,0..2000] of longint;
d:array[1..2000] of longint;
v:array[1..2000] of boolean;
max,n,k,x,y,i,j:longint;
function min(c,d:longint):longint;
begin
if c>d then
exit(d)
else exit(c);
end;
begin
read(n);
read(x,y,a[x,y]);
while x0 do
read(x,y,a[x,y]);
for i:=2 to n do
d[i]:=a[1,i];
for i:=2 to n do
begin
max:=0;
for j:=1 to n do
if (d[j]>max)and(not v[j]) then
begin
max:=d[j];
k:=j;
end;
v[k]:=true;
for j:=1 to n do
if (not v[j])and(min(a[k,j],d[k])>d[j]) then
d[j]:=min(a[k,j],d[k]);
end;
for i:=2 to n do
writeln(d[i]);
end.
Orz神牛
for j:=1 to n do
if (not v[j])and(min(a[k,j],d[k])>d[j]) then
d[j]:=min(a[k,j],d[k]);
这句是啥意思???
0 条评论
目前还没有评论...