Sol 期望DP+高斯消元. 根据本题题意列出期望方程\[E(i,j)=(1-p_i)(1-p_j)E(u,v)+(1-p_i)p_jE(u,j)+p_i(1-p_j)E(i,v)+p_ip_jE(i,j),u\in Edge(i,u),v\in Edge(j,v)\]移项得\[(1-p_i)(1-p_j)E(u,v)+(1-p_i)p_jE(u,j)+p_i(1-p_j)E(i,v)+(p_ip_j-1)E(i,j)=0,u\in Edge(i,u),v\in Edge(j,v)\] 然后就可…