-
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
-
2005011502_118573_ATM_MFC
一个模仿ATM提款机的MFC程序,具有ATM的所有功能。(An imitation of the MFC process ATM teller machines, with all the features of ATM.)
- 2008-04-19 22:06:55下载
- 积分:1
-
VC_and_matlab_mix_code
VC++与MATLAB的混合编程的快速实现 讨论了如何用MATLAB的complier将*.m函数编译为动态链接库DLL,供VC++使用的方法。(VC++ and MATLAB programming for fast implementation of mixed discuss how to use MATLAB' s complier to*. m functions compiled as dynamic link library DLL, VC++ for the methods used.)
- 2010-06-30 15:44:04下载
- 积分:1
-
gaussshuzhi
在matlab中用ROMBERG方法求二重积分(Seeking double integral using Romberg method in matlab)
- 2012-04-20 01:03:01下载
- 积分:1
-
mpso_bsplinea
malab语言实现bspline曲线拟合,采用改改进的pso算法实现 ,经测试可直接使用。
(malab the language bspline curve fit, change improved pso algorithm has been tested and can be used directly.)
- 2012-09-15 14:12:20下载
- 积分:1
-
ARINC429__HI-35XXApplication_Note
ARINC_429协议芯片的HI-3585__HI-3598_HI-3599_Application_Note(ARINC429 HI-3585__HI-3598_HI-3599_Application_Note)
- 2014-02-13 21:05:08下载
- 积分:1
-
Applications
说明: DEKTEC信号发生卡的控制软件,dos下面的控制台程序(example source code of DEKTEC player card)
- 2011-02-21 22:20:29下载
- 积分:1
-
PID3
各种经典PID的MATLAB程序,主要涉及温度控制,压力控制,液位控制等(All kinds of classic PID MATLAB procedures, mainly related to the temperature control, pressure control, level control, etc
)
- 2015-09-14 12:42:45下载
- 积分:1
-
zemax-Matlab
ppt文件,讲述如何使用matlab调用zemax中数据的文档(ppt file explains how to use the data in matlab call zemax document)
- 2013-08-07 13:09:18下载
- 积分:1
-
fftshift_and_triang
用C++实现了MATLAB中fftshift及triang函数功能,代码是实现此二功能的函数(With C++ Achieved in MATLAB function fftshift and triang function code is to achieve a function of these two functions)
- 2008-01-17 13:24:16下载
- 积分:1