ACboy needs your helpTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5022Accepted Submission(s): 2...
分类:
其他好文 时间:
2015-07-25 18:16:12
阅读次数:
102
Problem Description
ACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different course depending on the days he spend on it.How to ...
分类:
其他好文 时间:
2015-07-01 16:07:21
阅读次数:
135
Problem Description
ACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different course depending on the days he spend on it.How to arr...
分类:
其他好文 时间:
2015-05-10 15:49:01
阅读次数:
206
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1712解释看这里:http://www.cnblogs.com/zhangmingcheng/p/3940332.html这题之前竟然做过,竟然不记得了,做了一个小时,竟然没A,(我连分组背包干什么的都忘了)...
分类:
其他好文 时间:
2015-03-31 19:32:28
阅读次数:
110
问题
有N件物品和一个容量为V的背包。第i件物品的费用是c[i],价值是w[i]。这些物品被划分为若干组,每组中的物品互相冲突,最多选一件。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。
算法
这个问题变成了每组物品有若干种策略:是选择本组的某一件,还是一件都不选。也就是说设f[k][v]表示前k组物品花费费用v能取得的最大权值,则有:
f[k][v]=max...
分类:
其他好文 时间:
2014-12-20 15:37:21
阅读次数:
132
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1712分析: 典型的分组背包问题,如果不会的可以看一下背包九讲。 看下背包九讲中的描述: for 所有的组k forv=V..0 for 所有...
分类:
其他好文 时间:
2014-11-25 18:02:18
阅读次数:
179
将背包九讲往后看了看,学习了一下分组背包。来做几道入门题,试试手。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #inclu...
分类:
其他好文 时间:
2014-09-25 01:18:07
阅读次数:
286
1 //Accepted 400 KB 109 ms 2 //dp线性 3 //dp[i][j]=max(dp[i-1][k]+a[i][j-k]) 4 //在前i门课上花j天得到的最大分数,等于max(在前i-1门课上花k天+在第i门课上花j-k天得到的分数) 5 #include ...
分类:
其他好文 时间:
2014-09-18 23:31:34
阅读次数:
288
http://acm.hdu.edu.cn/showproblem.php?pid=1712Problem DescriptionACboy has N courses this term, and he plans to spend at most M days on study.Of cours...
分类:
其他好文 时间:
2014-08-27 21:40:58
阅读次数:
287
题目链接:
点击打开链接
题目:
ACboy needs your help
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3741 Accepted Submission(s): 1935
P...
分类:
其他好文 时间:
2014-05-22 10:56:10
阅读次数:
249