-
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
-
prog1
通信原理实验生成软件及相关代码,调制解调(C生成)(Communication principle experiment generation software and related codes, modulation and demodulation (C generated))
- 2014-09-17 20:13:40下载
- 积分:1
-
vVB__kalmaanb
vb语言实现的卡尔曼滤波源程序源码 (没有测测试,输出部分要配合相应的过程)
(the vb language Kalman filtering source source (not detected by the test, the output section with the corresponding process))
- 2012-08-29 22:49:37下载
- 积分:1
-
Wheel-And-Axle
基于matlab建立的关于汽车轴的控制模型,包括轴的运动方程和模型的建立。其实在ADVISOR中可以找到,不过,用matlab2012版重新建立了。(Established based on matlab axis control on the car model, including axis motion equations and model. ADVISOR can be found in the fact, however, re-established with matlab2012 version.)
- 2013-11-22 17:02:17下载
- 积分:1
-
nelder
downhill simplex问题 matlab 简单(Simplex Downhill matlab code)
- 2013-05-05 19:16:15下载
- 积分:1
-
jkshangwang
(实例171)监控上网过程,可以实现在上网过程中的控制((example 171) monitoring process online, the Internet can be achieved in the process control)
- 2006-05-30 13:05:17下载
- 积分:1
-
10
说明: matlab高效编程程序第十章,可以运行。(Chapter matlab programming procedure efficient, you can run.)
- 2011-04-10 15:32:10下载
- 积分:1
-
nengliang-zhongxin-jiaozhengfa
能量重心校正法,进行频谱的幅值修正,算法可以参见谢明、丁康老师的频谱分析文章。(Energy center of gravity correction method, the amplitude correction of the spectrum, spectrum analysis of the algorithm can be found in Xie Ming, DING Kang teacher article.)
- 2012-07-23 15:24:59下载
- 积分:1
-
dataTranlate
说明: 实现公历和农历之间的相互转换.包含了1899年到2100年202年的工农历数据,可以实现相互转换。(use to translate standard date and chinese data)
- 2010-03-23 20:16:32下载
- 积分:1
-
ising1.m
1D Ising
ising1(n,m,b,p)
n - length of domain, a positive integer
m - number of iterations, a positive integer
b - coupling parameter / temperature, a positive scalar
b = 0 -> Very high temp / low coupling
b > 1 -> Very low temp / high coupling( 1D Ising ising1 (n, m, b, p) n- length of domain, a positive integer m- number of iterations, a positive integer b- coupling parameter/temperature, a positive scalar b = 0-> Very high temp/low coupling b> 1-> Very low temp/high coupling)
- 2014-10-21 15:31:20下载
- 积分:1