Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
题目是0-1背包变式,网上的代码几乎都是用完全背包然后降维写的每个只能取1次,m就是背包大小,n就是个数,k是另外维护的数据,按照0-1来写优化降维的转移方程,外层for应该是n,第二层应该是背包容量从大往小遍历,防止取重,按照百度前几个那样写的话应该开三维数组,不然就是错的; Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator