RQ140 分配时间
分组背包
var u:array[1..11,0..101] of longint; f:array[0..100000] of longint; i,j,x,t,n,nam:longint; function max(a,b:longint):longint; begin if a>b then exit(a) else exit(b); end; begin readln(t,n,nam); for i:=1 to n do begin for j:=1 to t do read(u[i][j]); end; for i:=1 to n do for x:=t downto 0 do for j:=1 to t do if x-j-nam>=0 then f[x]:=max(f[x],f[x-j-nam]+u[i][j]); write(f[t]); end.