-
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
-
mpiv_toolbox
matlab的mpiv工具箱,用于处理mpiv图像(matlab progam s mpiv tools)
- 2014-08-20 19:29:40下载
- 积分:1
-
state
matlab gui界面主函数,所有界面函数的基础(matlab gui interface, the main function, the basis of all interface functions)
- 2015-03-23 20:04:46下载
- 积分:1
-
digital-processing
说明: 这是数字处理的发展总结,主要是OFDM中波束成向的技术总结(This is a summary of the development of digital processing, mainly into the OFDM technology in the summary of the beam)
- 2011-04-02 15:36:43下载
- 积分:1
-
GSR-VALUE
it use pc com port to receive and show over gui
- 2011-04-19 16:50:55下载
- 积分:1
-
dtwica
一种利用小波包变换进行盲信号分离的程序。(Program for blind source separation using wavelet packet transform.)
- 2013-02-05 01:05:18下载
- 积分:1
-
segitiga-matlab
this is to make a triangle wave in matlab
- 2013-09-11 10:04:23下载
- 积分:1
-
CPP-Primer-Plus
C++ Primer Plus,
作者 Stephen Prata
版本6ed, AW,
年份 2012
C++初级学者用书(C++ Primer Plus, Stephen Prata, 6ed, AW, 2012 C++ junior scholars books)
- 2013-12-13 17:22:18下载
- 积分:1
-
c4-matlab
dsp源代码 matlab c 代码 代码 代码(dsp c Matlab source cod e cod e cod e)
- 2007-02-05 16:59:50下载
- 积分:1
-
MATLAB
matlab 实现数字信号处理,单位抽样序列的产生(matlab digital signal processing, random sequence of units produced)
- 2009-01-06 09:12:58下载
- 积分:1