首先求出SCC缩点,E[T]=0,按拓扑序计算 对于无边连出的块,如果不是T所在块,则称该块是死路块 对于一个块,如果其中的点连出的边是死路块,则它也是死路块 否则对于每块进行高斯消元求出期望 如果S点所在块为死路块,则答案为INF #include<cstdio> #include<cmath> const int N=10010,M=1000010; int n,m,x,y,i,j,S,T; int g[3][N],nxt[3][M],v[3][M],ed,G[N],NXT[N…
Agent K is one of the greatest agents in a secret organization called Men in Black. Once he needs to finish a mission by traveling through time with the Time machine. The Time machine can take agent K to some point (0 to n-1) on the timeline and when…