Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:求助poj1991的Dp方程In Reply To:Re:求助poj1991的Dp方程 Posted by:597100700 at 2011-10-09 21:34:00 > 先按照Pi排序。F[i][j][0..1]表示第i个教室与第j个教室之间的作业还没收过,0表示在教室i,1表示在教室j的最小时间。 for a:=1 to n do for b:=n downto a do begin if a>1 then f[a,b,0]:=min(f[a,b,0],max(f[a-1,b,0]+x[a]-x[a-1],y[a])); if b<n then f[a,b,0]:=min(f[a,b,0],max(f[a,b+1,1]+x[b+1]-x[a],y[a])); if b<n then f[a,b,1]:=min(f[a,b,1],max(f[a,b+1,1]+x[b+1]-x[b],y[b])); if a>1 then f[a,b,1]:=min(f[a,b,1],max(f[a-1,b,0]+x[b]-x[a-1],y[b])); end; Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator