![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dp
文章平均质量分 78
Lawrence_Jang
这个作者很懒,什么都没留下…
展开
-
poj 3162 树形dp+单调队列 很好的题
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 1000000000#define linf 1000000000000000000LL#define dinf 1e原创 2012-10-08 20:51:03 · 897 阅读 · 0 评论 -
hdu 1231 最大连续子序列 yy+dp+数据结构解法
1:线段树解法 对于每一个i求出最大的(i-k)区间内的sum值及id#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#def原创 2012-10-23 17:41:46 · 1007 阅读 · 0 评论 -
hdu 4433 天津赛饮恨的c题·····事后才想出来
这题状态的设计主要在于后效性的消除,每步操作最多影响后面两位 然后预处理(枚举)出转移#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7原创 2012-11-01 16:05:18 · 1253 阅读 · 0 评论 -
hdu 2845 dp
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 1000000000000000000LL#defin原创 2012-11-02 11:04:58 · 446 阅读 · 0 评论 -
hdu 2870 Largest Submatrix
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 1000000000000000000LL#defin原创 2012-11-05 18:41:35 · 386 阅读 · 0 评论 -
hdu 2830 Matrix Swapping II
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 1000000000000000000LL#defin原创 2012-11-05 18:57:01 · 400 阅读 · 0 评论 -
hdu 1159 dp lcs nlogn解法
#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 1000000000000000000LL#define dinf 1e200#define eps 1e-11#define lng lo原创 2012-11-05 21:03:11 · 843 阅读 · 0 评论 -
hdu 1421 搬寝室
#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 1000000000000000000LL#define dinf 1e200#define eps 1e-11#define lng lo原创 2012-11-06 18:38:42 · 406 阅读 · 0 评论 -
hdu 1058 humble numbers
恶心的输出#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 1000000000000000000LL#define dinf 1e200#define eps 1e-11#define原创 2012-11-06 19:27:45 · 469 阅读 · 0 评论 -
hdu 2577 dp
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 1000000000000000000LL#defin原创 2012-11-01 15:36:05 · 458 阅读 · 0 评论 -
hdu 2955 水题却wa几次值得反思
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 1000000000000000000LL#defin原创 2012-10-23 11:14:53 · 436 阅读 · 0 评论 -
hdu 4258斜率优化 状态转移要仔细考虑
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 2000000000#define linf 1000000000000000000LL#defin原创 2012-10-10 21:45:58 · 384 阅读 · 0 评论 -
hdu 3593 树形依赖背包的优化
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 1000000000#define linf 1000000000000000000LL#define dinf 1e原创 2012-10-13 13:05:09 · 731 阅读 · 0 评论 -
poj 4045 树形dp
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 2000000000#define linf 1000000000000000000LL#defin原创 2012-10-13 16:23:10 · 359 阅读 · 0 评论 -
hdu 4383 树形dp
dp[N][2][2]dp[r][clo][0]表示r的子树为clo 且没有连接父亲节点的1操作存在dp[r][clo][1]表示子树颜色为clo除了r节点为rev此时存在连接父亲节点的操作leavesdp[r][clo][0]=0;dp[r][clo][1]=1;dp[r][rev][0]=1;dp[r][rev][1]=0;表示r节点可以用原创 2012-10-15 10:34:34 · 694 阅读 · 0 评论 -
hdu 4359 easy tree dp? dp+combination
5000组case每组数据一个N,D分别为节点数和深度求满足性质的二叉树个数mod 1e9+7对于非叶子节点r有性质如下leftsumN个节点的值已经确定为1到2^N-1的等比序列N D小于等于360从结果的大小来看不可能直接枚举出很显然 val[k]=sigma(val[1~k-1])+1val[k]=val[k-1]*2也就是说任意一个子原创 2012-10-18 13:12:16 · 413 阅读 · 0 评论 -
hdu 1069
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 1000000000000000000LL#defin原创 2012-10-30 16:37:44 · 427 阅读 · 0 评论 -
hdu 1505 city game
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 1000000000000000000LL#defin原创 2012-10-31 15:33:14 · 426 阅读 · 0 评论 -
hdu 1506 dp
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 1000000000000000000LL#defin原创 2012-10-31 15:17:37 · 411 阅读 · 0 评论 -
hdu 1789
对于可以补的subject 应该优先考虑分数大的 并且尽量延后时间,只需要按照分值大小排序然后依次安排即可#include#include#include#include#include#include#include#include#include#include#define iinf 0x7f7f7f7f#define linf 10000000000000原创 2012-11-07 15:30:01 · 473 阅读 · 0 评论