登录
首页 » Visual C++ » 0

0

于 2009-07-01 发布 文件大小:1KB
0 140
下载积分: 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 个回复

  • YJ12
    MATlab工具箱的多元优化求解问题,自己进行了一点更改,希望能够好用(MATlab optimization toolbox to solve diverse problems, themselves a little change in the hope of easy to use)
    2011-11-30 12:17:22下载
    积分:1
  • smat2c
    matlab语言转换成学语言,源程序主要用于生成粒子群算法(matlab language into learning the language, the source is mainly used to generate the PSO)
    2013-10-13 11:32:21下载
    积分:1
  • stransform
    s变换的C程序,简便实用,很容易读懂和理解,对于初学者来说,是掌握S变换的良好实例。(s transformation of C procedures, simple and practical, it is easy to read and understand for beginners, it is to master a good example of S transform.)
    2009-07-13 21:18:14下载
    积分:1
  • AsyncToolsfortheAsyncMinded
    window下 出口同步通信工具,提供c++源码,说明详细(window exporting synchronous communication tools, c++ source code, specify details)
    2007-05-12 23:28:23下载
    积分:1
  • HLSLA
    GPU编程 HLSL顶点渲染实例 对于刚学习HLSL的基础很重要哦!(HLSL vertex shader GPU programming examples for just learning the basis of a very important HLSL Oh!)
    2007-10-23 19:41:13下载
    积分:1
  • 08090822529040
    说明:  你电影广告RTR 泰国人好大方好古典风格 (Your movie ad RTR good generous good classical Thai style)
    2010-04-23 16:53:06下载
    积分:1
  • programming-Windows--fifth
    windows 程序设计 第五版 文字版,程序员经典丛书(Text version of the fifth edition of windows programming, programmers Classic Series)
    2014-02-03 12:16:23下载
    积分:1
  • Assignment6
    Bjarne Stroustrup的课后练习 1. Stroustrup, Chapter 17, Questions 11 and 13, Page 624–625. 2. Stroustrup, Chapter 19, Question 4, Page 709.(1. Stroustrup, Chapter 17, Questions 11 and 13, Page 624–625. 2. Stroustrup, Chapter 19, Question 4, Page 709.)
    2015-04-06 07:42:57下载
    积分:1
  • Matlab-pingfang
    自己在网上看到的一个关于平方根的求值方式,可以参考下(Themselves in line to see a square root to be evaluated on, you can refer to the following)
    2011-10-08 13:32:50下载
    积分:1
  • Doppler
    一种MIMO体制天波雷达多普勒扩展杂波抑制方法(Doppler radar system for MIMO-day extension clutter suppression method)
    2013-12-09 16:39:41下载
    积分:1
  • 696518资源总数
  • 104269会员总数
  • 42今日下载