这是怎么回事

bellman-ford

为什么第三个点会错..

编译通过...

├ 测试数据 01:答案正确... 0ms

├ 测试数据 02:答案正确... 0ms

├ 测试数据 03:答案错误... ├ 标准行输出

 ├ 错误行输出

├ 测试数据 04:答案正确... 0ms

├ 测试数据 05:答案正确... 0ms

---|---|---|---|---|---|---|---|-

Unaccepted 有效得分:80 有效耗时:0ms

program t1;

var

ea,eb,ec:array[1..11000]of integer;

tot:integer;

m,n:integer;

d:array[1..10000]of longint;

procedure init;

var

x,y,z,i:integer;

begin

fillchar(d,sizeof(d),0);

tot:=0;

readln(n,m);

for i:=1 to m do

begin

read(x,y,z);

if z=-1 then

begin

inc(tot);

ea[tot]:=x;

eb[tot]:=y;

ec[tot]:=1;

end;

if z=0 then

begin

inc(tot);

ea[tot]:=x;

eb[tot]:=y;

ec[tot]:=0;

inc(tot);

ea[tot]:=y;

eb[tot]:=x;

ec[tot]:=0;

end;

if z=1 then

begin

inc(tot);

ea[tot]:=y;

eb[tot]:=x;

ec[tot]:=1;

end;

end;

end;

procedure bellmanford;

var

i,j:integer;

begin

for i:=1 to n-1 do

for j:=1 to tot do

if d[ea[j]]

0 条评论

目前还没有评论...

信息

ID
1094
难度
7
分类
图结构 | 差分约束 点击显示
标签
(无)
递交数
1963
已通过
395
通过率
20%
被复制
8
上传者