传送门
先把所有区间按照左端点排序
f[i]表示区间0~i的最优解
#include <cstdio> #include <iostream> #include <algorithm> #define max(x, y) ((x) > (y) ? (x) : (y)) int n, v; int f[3000001]; struct node p[150001]; inline int read() inline bool cmp(node a, node b) int main() printf("%d\n", f[v]); return 0; }
上一篇:[luoguP2577] [ZJOI2005]午餐(DP)
下一篇:[luoguP1410] 子序列(DP)
DP









