登录
首页 » Visual C++ » 0

0

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

  • EpprogramE
    用于脑电分析的各类源码,包括功率谱密度检测,事件相关同同步/去同步分析,脑地形图绘制等,已通过测试。 (For EEG analysis of various types of source, including the power spectral density testing, events associated with synchronization/desynchronization analysis of brain topographic mapping, etc., has been tested.)
    2012-08-05 09:25:53下载
    积分:1
  • Pallecant
    方程求根的matlab程序,用的是平行法则,仅供参考(Roots of the equation matlab program, using a parallel rule, for reference only)
    2011-09-27 10:41:43下载
    积分:1
  • 2220005mcma0
    2005MCMA题程序源码,本程序源码码是自己编的,如有不足请见谅 (2005MCMA title of the program source code, the program' s source code is compiled, if insufficient please forgive me)
    2012-08-16 06:30:23下载
    积分:1
  • wavelet
    基于小波变换的mallat算法,用于检测信号的奇异性,实现励磁涌流的鉴别(Based the wavelet transform mallat algorithm for detection signal singularity inrush current identification)
    2012-12-19 19:24:31下载
    积分:1
  • ControlSys
    用vc调用matlab7.0写的小程序,可以实现简单的控制系统仿真演示(with vc call matlab7.0 write small programs, can achieve a simple control system simulation demo)
    2005-07-26 17:46:32下载
    积分:1
  • imgrayscaling
    matlab 实现图像 的缩小放大 (Enlarge Image narrowing matlab)
    2011-05-27 15:11:12下载
    积分:1
  • glp
    matlab 功率谱程序设计 (matlab power spectrum program design)
    2009-11-24 11:24:17下载
    积分:1
  • sample-nvidia-cpu-gpu
    Smple code using Nvidia programs prunted in pdf file
    2014-10-01 10:59:54下载
    积分:1
  • Kalman-filter_GUI
    卡尔曼滤波Kalman filter matlab GUI method M program 的matlab GUI实现方法 M程序 (Kalman filter matlab GUI method M program )
    2012-03-30 11:08:51下载
    积分:1
  • bingji
    对给定集合A和B,能够编出求A和B的并集C的程序。(For a given set A and B, can be compiled out of order to A and B, and the set of C procedures.)
    2009-12-23 13:19:48下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载