大牛帮忙!128错误是什么?

128错误是什么意思 `我新手\`一个朴素的最小树``大牛帮解释下为什么错误128?

program xx;

var num:set of char=['0'..'9'];

map:array[1..1000,1..1000]of real;

min:real;

i,j,n,k,l:longint;

s,w,x:real;

mincost:array[1..1000]of real;

costed:array[1..1000]of longint;

begin

fillchar(mincost,sizeof(mincost),0);

fillchar(costed,sizeof(costed),0);

readln(s);

readln(n);

for i:=1 to n do

for j:=1 to n do

map:=32767;

while not eof do

begin

readln(i,j,w);

map:=w;

map[j,i]:=w;

end;

for i:=1 to n do

begin

mincost[i]:=map[1,i];

costed[i]:=1;

end;

for l:=2 to n do

begin

min:=32767;

for i:=1 to n do

if (mincost[i]map[k,j]) and (mincost[j]0) then

begin

mincost[j]:=map[k,j];

costed[j]:=k;

end;

end;

min:=0;

for i:=2 to n do

min:=map[costed[i],i]+min;

if min>s then write('Impossible')

else write('Need',' ',min:0:2,' miles of cable');

end.

1 条评论

  • 1

信息

ID
1045
难度
7
分类
树结构 点击显示
标签
(无)
递交数
4938
已通过
1004
通过率
20%
被复制
10
上传者