| ||||||||||
| 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 | |||||||||
请教背包算法问题的源代码,谢谢了假设输入为 m ,n a[0],a[1],a[2].......a[n-1] m为背包总重量的最大值(不可以超过,但可以等于) n为 石头的数目 a[0]......a[n-1] 为每个石头的重量 写一个程序找出a数组的一部分数,使这些数尽量大,但不可以超过m 数组中每个数(石头)最多只可以取一次 输出第一行为取到的最大重量 第二行为该取的每个石头用空格分开 最好用C或C++ 谁帮我写一下,谢谢了 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator