-
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
-
F16-simulation
经典F16飞行控制仿真程序(含MDL及M源码)-MATLAB源代码(Classic F16 flight control simulation program-MATLAB source code (with MDL and M of source))
- 2021-01-02 11:18:57下载
- 积分:1
-
BP
说明: 这是一种BP神经网络的的MATLAB的代码有用请下载(if it help,please go ahead)
- 2014-09-14 18:28:58下载
- 积分:1
-
matrix_add
说明: matlab中add函数的C++实现,即矩阵加法的实现,包含条件判断(matlab add functions in C++ implementation, the realization of the matrix addition, including conditional)
- 2011-03-14 19:40:44下载
- 积分:1
-
udf_vel
udf的C源代码 fluent速度入口 速度函数为一个抛物线(C source code fluent udf velocity inlet velocity function is a parabola)
- 2014-09-26 22:00:42下载
- 积分:1
-
SGA-simple-Genetic-Algorithm
C语言编的简单遗传算法程序 各项功能齐全(SGA-simple Genetic Algorithm)
- 2011-05-23 16:24:14下载
- 积分:1
-
kalman
说明: kalman非常详细的原理说明,主要有介绍了几个原理公式,同时用了一个例子形象的说明原理(the introdution of kalman)
- 2010-04-26 15:17:09下载
- 积分:1
-
SPP
系统实现了笛卡尔坐标、大地坐标和站心坐标相互系转转换,以及单点定位、卫星历元信息查看功能。(Cartesian coordinate system implements, geodetic coordinates and topocentric coordinate mutual transfer system conversion, as well as single-point positioning, satellite epoch View feature.)
- 2013-11-24 21:37:58下载
- 积分:1
-
IJESS_paper7
Introduction to Evolutionary
- 2014-09-21 03:48:52下载
- 积分:1
-
ShowProcessList
显示进程列表,PID等相关信息,是初识windows进程编程的好材料(list shows the process, PID, and other relevant information, recognize the windows of the programming process good materials)
- 2007-06-05 00:23:23下载
- 积分:1