-
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
-
FoxFz_Band
高速采集 高速战斗 拦截封包 自动战斗 自制封包等等((High speed acquisition, high speed combat, intercept packets, automatic combat, homemade packets and so on))
- 2020-12-05 21:59:24下载
- 积分:1
-
EEG-LMS
可以去除脑电中的50Hz工频干扰,同时可以剔除部分生理伪迹,如眼电、肌电伪迹。( can be removed the 50Hz frequency interference of EEG, and can eliminate part of the physiological artifacts such as EOG, EMG.)
- 2015-10-14 19:18:39下载
- 积分:1
-
lucky38
hangle unicode used AI
- 2011-08-30 18:34:33下载
- 积分:1
-
word
VC word模板混合编程,在VC中操作word模板,能插入文字和图片(VC word template mixed programming, operation in VC word template, can insert text and pictures)
- 2020-06-29 12:20:02下载
- 积分:1
-
zishiyinceliang
此程序能够完成对电容元件的几何特性自适应测量。(This program can complete the adaptive measurement of geometric characteristics of the capacitor element.
)
- 2015-03-11 14:36:49下载
- 积分:1
-
Cpp1108
程序时用循环进行一些数据的输入输出 以及数据的更新等操作(Program carried out with the cycle of some of the data input and output, and data updating operations)
- 2016-02-16 11:21:48下载
- 积分:1
-
cleanProjectCPlusPlus
2 尝试设计翻译方法。假定对程序片段已得到语法树,如
if (a > b) b = a
已得到语法树
编写程序,遍历语法树,执行代码,得到正确结果。
(2 try to design Translation. Has been assumed for the program fragment syntax tree, such as if (a> b) b = a syntax tree has been writing programs, traverses the syntax tree, code, to get the correct results.)
- 2015-11-14 08:57:16下载
- 积分:1
-
MessageHook
可捕获系统消息,功能简单实用,是初学hook的理想资料(System can capture news, features simple, practical, is the ideal beginner hook information)
- 2009-06-06 20:27:44下载
- 积分:1
-
Laplacian-Gaussian-Model
文章介绍了一种基于拉普拉斯——高斯模型的语音端点检测算法!(This paper introduces a Laplace-based- voice endpoint detection algorithm Gaussian model!)
- 2015-03-20 22:31:30下载
- 积分:1