登录
首页 » Visual C++ » 0

0

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

  • essing
    说明:  利用C_Builder与Matlab实现实时数据的获取与处理(Matlab using C_Builder and real-time data acquisition and processing)
    2011-03-29 18:43:30下载
    积分:1
  • YunQiPaiBan
    一个简单的文本匀齐排版程序源代码,基于WIN32控制台的(A simple text smoothing Qi typesetting program source code, based on WIN32 console)
    2010-01-05 13:29:56下载
    积分:1
  • VS2005CallMatlab
    VS2005调用matlab,适合于初学者学习研究(VS2005callmatlab,for the students who study early)
    2011-12-05 16:10:16下载
    积分:1
  • H1
    说明:  运用相移延拓的方法有效地模拟地震波在介质中的传播路径。(Extension of the use of the phase shift method can effectively simulate seismic wave propagation path in the medium.)
    2015-04-14 10:46:06下载
    积分:1
  • buffertest
    this ring buffer sample.
    2006-09-06 11:49:48下载
    积分:1
  • Fractals
    图像分形盒维数的算法源程序.此算法是基于黑白二值图像的,因此,需要对导入的图片进行二值化处理,因此算法存在一定误差,但是此算法误差控制在4 以内(Image fractal dimension algorithm source code box This algorithm is based on black and white binary image, and therefore, need to import the picture binarization processing, so the algorithm there are some errors, but this algorithm is less than 4 error control)
    2011-10-18 18:43:03下载
    积分:1
  • APFSVPWM
    APF仿真模型,用于动态补偿系统的无功功率!(APF simulation model for dynamic compensation system reactive power!)
    2013-05-07 15:35:46下载
    积分:1
  • 212
    基于快速傅里叶变换的MATLAB实现,内附有源程序(MATLAB based on fast Fourier transform implementation, enclosing a source)
    2011-05-22 14:06:36下载
    积分:1
  • Density_Evolution
    LDPC码理论方面的高性能密度进化仿真测试例程,可以跑出数值结果(LDPC DENSITY EVOLUTION)
    2013-10-03 16:49:20下载
    积分:1
  • shuzituxiang
    这是一个数字图像处理的matlab仿真程序,效果比较好(This is a digital image processing matlab simulation program, the effect is better)
    2009-03-15 23:07:05下载
    积分:1
  • 696518资源总数
  • 105873会员总数
  • 12今日下载