随笔分类 -  动态规划——背包问题

摘要:分数规划+树形依赖背包 "orz" 阅读全文
posted @ 2018-05-16 16:00 poorpool 阅读(223) 评论(0) 推荐(0)
摘要:超 dark van♂全背包 "ref1" "ref2" 阅读全文
posted @ 2018-05-06 20:02 poorpool 阅读(291) 评论(0) 推荐(0)
摘要:真的是裸背包啊…… cpp include include using namespace std; typedef long long ll; int n, k[125], c[125], sum[125]; ll m, dp[125][240795]; int main(){ cin n m; 阅读全文
posted @ 2018-04-17 08:34 poorpool 阅读(170) 评论(0) 推荐(0)
摘要:设dp[i][j][k]表示前i个数中选j个并且因子含有k个2的能获得的最多的5的个数 则dp[i][j][k]=max(dp[i 1][j][k],dp[i 1][j 1][k cnt2]+cnt5) 滚掉一维 cpp include include include using namespace 阅读全文
posted @ 2018-01-23 18:41 poorpool 阅读(185) 评论(0) 推荐(0)
摘要:搜索+背包就是了 cpp include include include using namespace std; int n, m, a[25], ans=0, lst=0; bool isu[25], f[2005]; void dfs(int x){ if(x==m+1){ int cnt=0 阅读全文
posted @ 2017-12-19 20:43 poorpool 阅读(112) 评论(0) 推荐(0)