显而易见的tarjan+spfa...不解释了 ; type edgetype=record toward,next:longint; end; var edge1,edge2:..maxn] of edgetype; first1,first2,scc,stack,dfn,low,val,sum,q,d:Array[..maxn] of longint; pd:..maxn] of boolean; num,tot,n,m,cnt,top:longint; function min(x,y:l…