-
0
说明: 给定n种物品和一个背包,物品i的重量是Wi,价值是vi,被包容量是C,应该如何选择装入被包的物品,使得装入背包中物品的总价值最大?对于每种物品i,只有两种选择,装入或者不装入.
输入:第一行两个正整数n(物品数)和C(容量)
第二行n个正整数n,表示物品价值
第三行n个正整数n,表示物品重量
输出:第一行表示总价值
第二行n个数(0/1),0表示物品不装入,1表示装入
例如,
输入:
5 10
6 3 5 4 6
2 2 6 5 4
输出
15
1 1 0 0 1
(Species of a given n items and a backpack, the weight of item i is Wi, the value of vi, was packet capacity is C, should be how to choose a package of items to be loaded, the backpack load in the largest total value of goods? For each item i, there are only two options, loaded or not loaded. Input: the first line of the two positive integer n (the number of items) and C (capacity) of the second line of n positive integer n, that the value of the third line of n positive integer n, that the weight of output: the total value of the first line of the second line, said n number of (0/1), 0 that the items do not load, that load 1 for example, enter: 5,106,354,622 6 5 4 output 15 1 1 0 0 1)
- 2009-07-01 23:07:01下载
- 积分:1
-
EKF2
说明: 原代码包括捷联惯导初始对准程序,实用性强,便于学习(chushiduizhun)
- 2010-04-22 22:49:22下载
- 积分:1
-
wind_power_in_power_systems
研究风电接入对电力系统影响的经典书籍,适用于相关专业人士(classical text book to learn about winder power and its affect on power system)
- 2012-01-19 23:36:37下载
- 积分:1
-
Survivability-of-network
以生存性、最小生成树数目和介数评价网络节点的重要性。(Survivability, the number of minimum spanning tree and the number of referrals to evaluate the importance of the network nodes.)
- 2013-05-10 15:04:19下载
- 积分:1
-
LMSzishiyinglubo
自适应滤波,用LMS算法做的,供大家参考(Adaptive filter, LMS algorithm used to do, for your reference)
- 2011-06-02 02:37:16下载
- 积分:1
-
3weiinitial
基于粒子群算法的一点个人的研究,希望与大家共同进步 (Particle swarm optimization based on a personal research, hope and progress together)
- 2011-01-04 19:42:52下载
- 积分:1
-
Shannon
随机产生一个信源概率空间,并对其进行香农编码,输出码长和编码(shannon coding)
- 2014-12-22 21:01:05下载
- 积分:1
-
MPU6050-DMP
MPU6050陀螺仪,代码,技术文档, 测试程序(MPU6050 gyroscope, code, technical documentation, test programs)
- 2013-10-06 14:03:59下载
- 积分:1
-
CT
说明: 通过调制解调器实现远程定时采集信息,分析等功能。(Remotely via modem from time to time collect information, analysis and other functions.)
- 2008-09-14 10:36:28下载
- 积分:1
-
Phw__diodee4o
电源四个二极管构成的整流电路SIMULIINK仿真模型,一种基于MATLAB7.0
(The power four diodes constituting a rectifier circuit SIMULIINK simulation models, one based on MATLAB7.0)
- 2012-09-09 23:45:21下载
- 积分:1