-
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
-
Deploy-Nodes
Distribution_Of_WSN代码(square_random.asv Distribution_Of_WSN)
- 2011-08-08 18:55:32下载
- 积分:1
-
CodeCoverageTool
The Code Coverage Tool (CCT) Matlab代码转化用于实时仿真的S函数。(The Code Coverage Tool (CCT) measures C statement coverage in code built as a Real-Time Workshop S-Function. It operates in conjunction with lcc (the C-Compiler that ships with the standard MATLAB installation).)
- 2009-09-11 17:49:11下载
- 积分:1
-
TSP
任务均分的多旅行商问题的解决办法(很有价值)(Divided equally between the mission of the multi-traveling salesman problem solution (very valuable))
- 2007-08-14 08:55:39下载
- 积分:1
-
Automatic_Modulation_Recognition_of_Communication_
信号识别经典教材
Automatic Modulation Recognition of Communication Signals(Automatic Modulation Recognition of Communication Signals)
- 2010-12-30 10:23:52下载
- 积分:1
-
Chineseflag
利用matlab强大的功能,可以画出中国国旗的一个小程序!(Using matlab powerful features, you can draw the flag of a small program in China!)
- 2011-01-04 10:46:56下载
- 积分:1
-
kalman-detection
使用卡尔曼滤波算法实现的跟踪,运动估计,运动跟踪等等(Using the Kalman filter to track)
- 2012-04-01 14:18:32下载
- 积分:1
-
sampen
样本熵在信号分析中有很重要的作用,其主要用来提取非线性特征,从而用于特征分析。(Sample entropy has a very important role in signal analysis, which is mainly used to extract the nonlinear characteristics for analysis.)
- 2013-03-30 11:28:55下载
- 积分:1
-
mphtxt_read
读入COMSOL软件所生成的三维mphtxt四面体网格文件,读入相关网格的节点、四面体单元,边界信息。调用此函数时应将包含相关的路径与文件名的字符串作为输入参数。包中包含了一个m函数文件与一个示例网格数据文件。(read the information of 3-d tetrahedron mesh file--*.mphtxt generated by COMSOL. The input parameter is the path and name of mesh file. A matlab source file and mesh file is included in it.)
- 2021-03-20 22:39:18下载
- 积分:1
-
Havel
这是图论里面的一个定理,即Havel定理,它是用来判断一系列的度的序列能否组成一个简单图,在这儿我实现了它。(This is the inside of a theorem of graph theory, that Havel theorem, which is used to determine whether a series of sequences degrees to form a simple graph, here I realized it.)
- 2014-02-25 16:22:50下载
- 积分:1