先上我原来的错误的代码 type node=^link; link=record num:int64; next:node; end; var fa:..,..] of int64; dep:..] of int64; nd:..] of node; b:..] of boolean; dl:..] of int64; n,m,maxdep,ans,t1,t2:int64; i:longint; procedure maketree; var t1,t2,head,tail:int64; i,j…