[USACO06DEC]Cow Roller Coaster S & [USACO07NOV]Milking Time S 题解 线段覆盖类题目
T1题目如果用背包的方式理解:类似二维费用背包。fi,j,kf_{i,j,k}fi,j,k表示前iii个线段,[0,j][0,j][0,j]花费为kkk的最大收益。fi,endi,k=max(fi−1,endi,k,fi−1,starti,k−ci+vi)f_{i,end_i,k}=\max(f_{i-1,end_i,k},f_{i-1,start_i,k-c_i}+v_i)fi,endi,k=