-
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
-
MATLAB
说明: matlab命令大全,记住matlab命令,帮助大家更好的学习和掌握matlab(Guinness command matlab,matlab command remember to help you better grasp of learning and matlab)
- 2009-08-19 10:46:28下载
- 积分:1
-
analysis-tempreture-by-EEMD
EMD方法分析全球温度异常_源程序。
eemd.m——总体经验模态分解;
ifndq.m——获得瞬时频率;
significance.m——统计显着性检验。(To analysis the annual mean global surface temperature anomaly by EMD.
eemd.m——Ensemble Empirical Mode Function
ifndq.m——The instantaneous frequency can be obtained through calling the function
significance.m——Statistical significance test.)
- 2020-06-30 22:20:02下载
- 积分:1
-
lmax
实现极大值查找,可输出数值和下标,并带有阈值功能。(search for maximum value)
- 2011-12-18 16:50:55下载
- 积分:1
-
three_level_SVPWM
基于matlab/simulink搭建的三电平逆变器仿真模型,控制算法为电压空间矢量控制(SVPWM),算法部分使用m语言编写,带有简单注释,配合算法说明,应该比较好懂。模型带中点电压平衡处理,但是效果一般,大家可以在此模型基础上修改。欢迎交流讨论。(Three-level inverter simulation model matlab/simulink structures based control algorithms for the voltage space vector control (SVPWM), part of the algorithm using the m language, with a simple comment, with the algorithm description, it should be relatively easy to understand. Models with the midpoint voltage balanced, but the general effect, you can modify the model basis. Welcome exchanges and discussions.)
- 2020-11-29 14:39:29下载
- 积分:1
-
acent
最优化算法中最速下降法的Matlab源码,很不错的源码,希望对你有用。(Optimization algorithm in the steepest descent method of Matlab source code, it is a good source, I hope useful to you.)
- 2010-08-19 05:42:03下载
- 积分:1
-
power_transfohyst
power_transfohyst.rar,功率电子领域matlab仿真文件,已经验证过,程序运行正常(power_transfohyst.rar,Power electronics field matlab simulation file, has already been verified, the normal operating procedures)
- 2013-08-26 22:15:50下载
- 积分:1
-
TCP
工业机械臂末端TCP标定代码 含有位置和姿态的标定 matlab版本 方便易用 精度较高(Facilitate industrial arm end TCP calibration codes including the position and orientation of the calibration matlab version of high precision and easy to use)
- 2015-11-22 18:24:59下载
- 积分:1
-
OMPdemo
SAR图像压缩感知图像处理,用于压缩感知处理后的SAR图像进行图像重建与恢复(SAR image compression sensing image processing, image sensing processing for compressing SAR image after reconstruction and restoration)
- 2016-04-05 09:51:03下载
- 积分:1
-
amosa
进化计算会刊的模拟退火多目标优化 大家的杰作 很有参考价值(Multi-objective optimization by simealted fire)
- 2021-03-24 21:19:14下载
- 积分:1