比较简单的数学期望,先预处理出当聪聪在i,可可在j时聪聪往哪个点走然后做dp即可,我用了记忆化搜索实现 type node=record po,next:longint; end; ..,..] of longint; f:..,..] of double; v:..] of boolean; e:..] of node; c,p,q:..] of longint; len,s,t,i,j,n,m,x,y:longint; procedure add(x,y:longint); begin in…