- 想越狱的小杉
- 2009-11-01 22:13:57 @
想越狱的小杉
大牛帮我看下
program ex;
var i,j,n:longint;
map:array[1..2000,1..2000]of longint;
way:array[1..2000,0..2000]of longint;
dis:array[1..2000]of longint;
procedure init;
var i,j,x,y,z:longint;
begin
fillchar(way,sizeof(way),0);
fillchar(map,sizeof(map),0);
readln(n);
readln(x,y,z);
while (x0)and(y0)and(z0) do
begin
inc(way[x,0]);
way[x,way[x,0]]:=y;
map[x,y]:=z;
readln(x,y,z);
end;
end;
function min(a,b:longint):longint;
begin
if a>b then exit(b) else exit(a);
end;
procedure spfa;
var i,j,h,t:longint;
que:array[1..10000]of longint;
begin
filldword(dis,sizeof(dis)div 4,-maxlongint);
dis[1]:=maxlongint;
que[1]:=1;
h:=1;t:=1;
while h
3 条评论
-
fbc LV 7 @ 2016-07-07 20:11:40
floyd过得了?
-
2016-06-27 16:20:12@
对不起我晚生了7年
-
2016-06-27 16:19:35@
这题明显用floyd
- 1