登录
首页 » Visual C++ » 0

0

于 2009-07-01 发布 文件大小:1KB
0 218
下载积分: 1 下载次数: 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)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • biaogao4
    机械设计及理论 转子动力学中对轴承的研究(Mechanical Design and Theory Rotor Dynamics)
    2013-10-08 10:47:31下载
    积分:1
  • Bbeiijingyidoa
    背景移动补偿技术的研究,是关于车辆检测期间对于背景移动的情况进进行的补偿技术的改进性的研究,希望对大家有所帮助。 已通过测试。 (Background compensation mobile technology, are about the context of vehicle detection during the moovement for the compensation technique to improve the research, hoping for U.S. help. Have passed the )
    2012-05-18 15:55:16下载
    积分:1
  • MATLAB-and-VC-of-wavelet
    MATLAB与VC++混合编程实现一维小波多尺度分解(MATLAB and VC programming mix of one-dimensional wavelet decomposition)
    2011-12-29 08:13:49下载
    积分:1
  • Bubble-Sort
    Bubble Sort Search Algorithm Implementation Document of Data Structures
    2014-12-13 01:33:33下载
    积分:1
  • HaarPAdaBoost
    Haar+AdaBoost分类器训练总结(Haar+ AdaBoost classifier training summary)
    2015-04-07 10:03:20下载
    积分:1
  • xbcseeg02
    自己编写的基于要所感知的脑电信号预处理,代码效率良好,而且程序架构简单易行。(I have written EEG signal preprocessing based on the perceived good code efficiency, and procedural framework is simple.)
    2012-06-27 16:23:41下载
    积分:1
  • @rtdxhelp
    说明:  一个MATLAB的应用程序,很方便的!使用时需要转换为M文件。(A MATLAB application, very convenient! The use of M need to convert files.)
    2006-03-16 16:30:41下载
    积分:1
  • RichTextBox
    RichTextBox带行号可滚动 RichTextBox with line numbers can scroll(RichTextBox with line numbers can scroll)
    2014-08-25 16:09:17下载
    积分:1
  • Hhossa_ddi
    高阶谱分析工具箱,有常见的参数模模型高阶谱估计,DOA估计与时延估计 (Higher order spectral analysis toolbox, common parameter-mode model of higher order spectral estimation of DOA estimation and delay estimation)
    2012-07-17 23:10:21下载
    积分:1
  • CCppt
    Clear Case briefly introduction power point
    2013-09-25 10:03:02下载
    积分:1
  • 696518资源总数
  • 105540会员总数
  • 37今日下载