[luoguP1868] 饥饿的奶牛(DP)


传送门

先把所有区间按照左端点排序

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)

下一篇:[luoguP1896] [SCOI2005]互不侵犯King(状压DP)


DP
Copyright © 2002-2019 k262电脑网 www.k262.cn 皖ICP备2020016292号
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!QQ:251442993 热门搜索 网站地图