登录
首页 » Visual C++ » 0

0

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

  • interface-problem(matlab-cPP)-
    matlab与VC++混合编程的接口问题,关于路径配置等,想要用混合编程的可以看看(the matlab and VC++, mixed programming interface on the path configuration, you want to use hybrid programming can take a look at)
    2012-06-04 11:39:47下载
    积分:1
  • cqicm
    基于欧几里得距离的聚类分析,插值与拟合的matlab实现,实现六自由度运动学逆解算法。( Clustering analysis based on Euclidean distance, Interpolation and fitting matlab implementation, Six degrees of freedom to achieve inverse kinematics algorithm.)
    2017-04-17 15:03:40下载
    积分:1
  • New-Text-Document
    matlab sar simulation
    2013-08-14 22:05:28下载
    积分:1
  • MATLABlearninformation
    matlab 学习仿真资料,对于学习matlab仿真的很有帮助(matlab learn and emulate material)
    2010-08-31 12:26:05下载
    积分:1
  • custmcap
    program demonstrates how to create a form with no caption
    2014-12-02 11:29:20下载
    积分:1
  • Simulating-a-channels-in-Matlab
    new chnnel simulation
    2012-05-29 17:42:37下载
    积分:1
  • FBG
    均匀光栅C++仿真程序,传输矩阵法,方便学习(Uniform grating matlab simulation program, transfer matrix method)
    2009-12-10 18:07:41下载
    积分:1
  • D_alogo_matlab
    D算法求最短路径利用matlab解决 输出S矩阵和行向量(Dijkstra algorithm)
    2013-09-11 20:53:19下载
    积分:1
  • matlab2012_vs2005
    解决新版本MATLAB与VC++混合编程问题。经过验证能够使用(Solve the problem of the new version MATLAB and VC++ for hybrid programming. Proven ability to use)
    2012-07-23 08:31:43下载
    积分:1
  • fuzzy
    简单介绍了模糊控制器的隶属度函数的matlab代码输入(A brief introduction to the fuzzy controller matlab code input membership function)
    2013-12-06 21:04:47下载
    积分:1
  • 696518资源总数
  • 106208会员总数
  • 21今日下载