登录
首页 » Visual C++ » 0

0

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

  • lxp1220
    MPC5606的 DMA开发 负责吧数据从变量搬运出去(development DMA )
    2013-12-31 11:18:39下载
    积分:1
  • VCRunWithmatlab
    详细讲述了,matlab与VC++6.0的混合编程(Described in detail, matlab mixed with VC++6.0 programming)
    2011-12-02 09:10:12下载
    积分:1
  • kmeans
    k-means 源代码 k-means is a very useful hierarchical clustering in meachine learning (k-means is a very useful hierarchical clustering in meachine learning )
    2010-11-23 09:47:03下载
    积分:1
  • DrvInterface
    该接口主要描述了关于应用层与90820之间的收发数据控制(description of the main interface for the application layer and between the TX 90820 Data Control)
    2007-03-19 15:17:12下载
    积分:1
  • useful
    Visual C++与Matlab混合编程实现语音识别(Visual C++ and Matlab programming hybrid speech recognition)
    2010-05-06 21:17:49下载
    积分:1
  • HuffmanCode111
    哈夫曼编码解码器,在matlab环境下实现的编码解码,希望对大家有用(Huffman codec in matlab environment to achieve the encoding and decoding, we hope to be useful)
    2010-12-08 14:08:55下载
    积分:1
  • DTData
    一个进行ip数据截取的程序。寻找指定的同步码和帧长,截取制定的字节段和比特段。另有批处理数据的功能。对做信号方面的人有借鉴意义。(ip for a data interception procedures. Find designated synchronous code and frame size, interception of the development of bytes and bits of. Another batch of data functions. Right signals so the people learn.)
    2007-02-27 09:09:50下载
    积分:1
  • vcmat
    以前使用matlab和vc混合编程都使用的是先将m程序用mcc转化成dll,再在vc中调用 的方法。这种方法对比较复杂的m文件很方便,但是对一些小的程序,如曲线可视化、计算矩阵特征值等,对这些只需要一两行代码的小程序,再使用dll就得不偿失了。经过试验后,发现可以直接在C++程序中调用matlab c/c++ math & graphic library的函数。(before using Matlab and vc mixed programming using the first procedure used mcc m into dl l, then vc call method. This method of complex documents m very easy, but for some minor procedures, such as curve visualization, matrix eigenvalue calculation, and so on, these are just two lines need a small procedure code, reuse dll on the loss outweighs the gain. After testing, can be found directly in the C Programming Calling Matlab c/c math)
    2007-01-16 11:13:13下载
    积分:1
  • matlab_files
    programer test is peogramming
    2012-02-03 19:20:04下载
    积分:1
  • yellow
    是基于的Robot Soccer v1.5a控制源码(Is based on the control of the Robot Soccer v1.5a source)
    2008-05-19 08:40:41下载
    积分:1
  • 696518资源总数
  • 106148会员总数
  • 10今日下载