很像最大权闭合子图的题目s向每个工作连边,流量为收益每个工序,由工作i向对应机器连边,流量为租用费每个机器向t连边,流量为购买费显然跑最小割,ans=总收益-mincut ; type node=record flow,next,point:longint; end; ..] of node; pre,p,cur,numh,h,d:..] of longint; ans,n,m,j,t,len,a,b,x,y,i:longint; function min(a,b:longint):longin…