登录
首页 » Visual C++ » 0

0

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

  • Pviterbi_encor
    经过验证的维特比编译码MATLLAB程序,每行代码都有详细的备注 (Proven Viterbi than the codec MATLLAB program, each line of code to have detailed notes)
    2012-08-16 06:34:29下载
    积分:1
  • fiber-mode-LP03
    利用matlab实现光纤的模式分布图的模拟。(Using matlab to achieve mode fiber distribution simulations.)
    2013-07-30 10:10:48下载
    积分:1
  • jisuanxiangying
    计算三层框架的损伤前后响应的对比,对于结构健康监测比较实用(Three frames before and after damage calculation response contrast, more practical for structural health monitoring)
    2013-10-26 09:50:55下载
    积分:1
  • MATLAB
    关于学习C++的资料,适合初学者使用,有关数学建模(Learning C++ on the information, suitable for beginners, the mathematical modeling)
    2010-09-28 10:55:32下载
    积分:1
  • yiweiFDTD1d
    一维的MATLAB的FDTD的仿真程序,可帮助初学者对FDTD有所帮助。(One-dimensional FDTD simulation of the MATLAB program to help beginners on the FDTD help.)
    2009-04-19 16:29:18下载
    积分:1
  • DSSS
    基于MATLAB的直扩信号的产生,扩频,调制解调以及解扩(matlab dsss )
    2011-07-16 11:01:59下载
    积分:1
  • ftwt
    matlab可以方便地实现付利叶变换,为了在vc中实现这样的精度,有次程序。(matlab can easily achieve profits Fourier transform, in order to achieve vc such precision, there are times procedures.)
    2008-01-16 20:26:45下载
    积分:1
  • GLMetaseq.h
    让ARToolKit支持MQO模型的必须头文件,GLMetaseq.h(Let ARToolKit support MQO model must header files, GLMetaseq.h)
    2014-02-09 23:10:11下载
    积分:1
  • chengxu.
    在主程序中实现输入输出,分别输入一个整数a和一个实数b作为底数,再输入一个整数m作为指数,输出am和bm。(Realized in the main input and output, respectively, enter an integer a and b as the base of a real number, then enter an integer m as an index, output am and bm. .)
    2015-01-12 21:36:05下载
    积分:1
  • matlab_fem
    Introduction to programming finite element with matlab
    2012-12-01 04:49:46下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载