<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">最小花费</span>【题目描述】
【源代码】/pas
<pre name="code" class="delphi">var n,m,i,j:longint; v:array[1..2000,1..2000]of real; b:array[1..2000]of boolean; d:array[1..2000]of real; x,y,z,u,s,e:longint; min:real; begin readln(n,m); for i:=1 to m do begin readln(x,y,z); v[x,y]:=(100-z)/100; v[y,x]:=(100-z)/100; end; readln(s,e); b[s]:=true; d:=v[s]; repeat min:=0;//maxlongint; u:=0; for i:=1 to n do if (not b[i])and(d[i]>min) then begin min:=d[i]; u:=i; end; if u<>0 then begin b[u]:=true; for i:=1 to n do if (not b[i])and(d[u]*v[u,i]>d[i]) then d[i]:=d[u]*v[u,i]; end; until u=0; writeln(100/d[e]:0:8); end.