- 联合权值
- 2015-08-03 09:21:47 @
program aweunit;
var
n,i,x,y,j,temp:longint;
a:array[1..2000,1..2000] of integer;
b:array[1..2000] of longint;
begin
read(n);
for i:=1 to n-1 do
begin
read(x,y);
a[x,y]:=1;
a[y,x]:=1;
end;
for i:=1 to n do
read(b[i]);
for i:=1 to n do
begin
if (a[i-2,i-1]=1) and (a[i-1,i]=1) then
begin
temp:=temp+(b[i-2]*b[i]);
if (b[i-2]*b[i]) >j then
j:=b[i-2]*b[i];
end;
end;
temp:=temp*2;
temp:=temp mod 10007;
writeln(j,' ',temp);
end.
样例是过的,但提交一个点也不过
1 条评论
-
冲啊小笼包 LV 9 @ 2015-11-04 18:55:34
想让人帮你还发无法编译的程序是在钓鱼??
- 1