忘写题解了,经典的最大密度子图 可以类似分数规划的做,二分密度,然后转化为最大权闭合子图做,判断是否大于0 注意方案的输出 const eps=1e-6; lim=1e-12; inf=; type node=record po,next:longint; flow:double; end; ..] of node; numh,h,cur,pre,p,x,y:..] of longint; v:..] of boolean; d:..] of double; len,i,n,m,t,ans:lo…