-
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
-
matlab-ego-motion
基于matlab实现的自身运动估计仿真程序。通过对视频图像的分析,快速估计摄像机自身的运动状态。(Estimate based simulation program matlab realize their movement. Through the analysis of video images, the camera quickly estimate its state of motion.)
- 2014-09-26 19:43:20下载
- 积分:1
-
fmmod
uses the message signal X to modulate the carrier frequency Fc (Hz) and sample frequency Fs (Hz), where Fs >
2*Fc. FREQDEV (Hz) is the frequency deviation of the modulated signal.
- 2007-10-22 15:47:00下载
- 积分:1
-
dftidft
MATLAB软件实现计算有限长序列的DFT和IDFT函数的程序,另有一个实例(MATLAB software calculation of finite-length sequence of DFT and IDFT function procedures, while an example of)
- 2009-05-27 13:45:46下载
- 积分:1
-
SUIsimulation
说明: 对SUI-3信道仿真和分析的文章,很不错,与大家分享!(On SUIchannel simulation and analysis of the article, it is good to share with you)
- 2010-04-16 00:02:49下载
- 积分:1
-
cl_object
Client objects implement io operations and cache pages.
- 2014-09-19 11:04:38下载
- 积分:1
-
LIBRA_31okt11
kernel-ica package is a Matlab program that implements the Kernel
ICA algorithm for independent component analysis (ICA). The Kernel ICA
algorithm is based on the minimization of a contrast function based on
kernel ideas.
- 2013-10-03 10:11:54下载
- 积分:1
-
Dijkstra
图论中用dijkstra算法求解最短路问题的MATLAB代码,可求任意一点至其它所有点的最短距离和最短路径。(Dijkstra algorithm using graph theory shortest path problem MATLAB code, can be uated at any point to the shortest distance and shortest path to all other points.)
- 2014-11-04 21:27:25下载
- 积分:1
-
fuzzy1
this matlab code is for commande of system by PI controller
- 2015-02-04 22:00:43下载
- 积分:1
-
intant
适合初学者学习的智能天线波束成形的MATLAB仿真程序(It s used for freshman in the study of smart)
- 2010-10-29 10:31:07下载
- 积分:1