首先缩点然后半连通其实就是缩点后节点数最多的链注意这里一定是一条链才一定是半连通然后重建图拓扑排序上做dp即可 type node=record po,next:longint; end; ..] of node; rd,be,c,f,g,p,q,st,dfn,low:..] of longint; v:..] of boolean; s,mo,i,n,m,x,y,j,h,t,ans1,ans2,len:longint; function min(a,b:longint):longint; be