-
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
-
gomory
割平面在MATLAB里的程序,很好用,希望和大家分享(Cutting plane in the MATLAB program, useful, and would like to share)
- 2012-05-30 00:02:56下载
- 积分:1
-
pso_more
说明: 将标准微粒群算法进行改进,从而解决标准PSO算法的容易陷入局部最优解的情况。(The standard particle swarm algorithm is improved so as to solve the standard PSO algorithm is easy to fall into local optimal solution of the situation.)
- 2011-04-05 17:27:47下载
- 积分:1
-
ch5_matDemo
高成编写的《matlab接口技术与应用》中例题的源代码(High into the preparation of the " matlab interface technology and applications" in the source code examples)
- 2010-10-19 22:14:10下载
- 积分:1
-
TSP-PSO
TSP-PSO算法的matlab程序文件,有助于了解该算法(The produce of matlab about TSP-POS)
- 2013-04-13 22:37:55下载
- 积分:1
-
NEUTETDesign
说明: 神经网络设计书籍配套源码,Matlab的只有源码,没有配套教材哦(neural network design books matching source, the only source of Matlab, oh no supplementary materials)
- 2006-03-17 17:12:30下载
- 积分:1
-
TSP
说明: 算法仿真,很好用蚁群算法算法仿真,很好用蚁群算法(Algorithm simulation, a good simulation algorithm using ant algorithm, ant colony algorithm with good)
- 2008-10-13 20:23:26下载
- 积分:1
-
saolei
这是一本很经典的教程!不知道有人传过没有。先传上来,希望有用(This is a very classic tutorial! Some people do not know they could not mass. Chuan-first onto the hope that useful)
- 2008-03-24 18:38:04下载
- 积分:1
-
Kalman
卡尔曼滤波程序,C++/C,matlab.(Kalman filtering procedures, C++/C, matlab.)
- 2012-08-06 11:11:18下载
- 积分:1
-
MATLAB1
当前MATLAB在数字图像处理和分析中的应用(MATLAB in digital image processing and analysis)
- 2013-03-02 20:53:15下载
- 积分:1