登录
首页 » Visual C++ » 0

0

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

  • VCPP-Matlab
    VC++与Matlab混合编程之引擎操作详解(VC++ and Matlab programming of hybrid engine Operational Details)
    2011-09-27 18:05:53下载
    积分:1
  • CandMatlab
    一个典型的MATLAB河VC++的混合编程,对刚刚起步学习的人很有帮助(a typical VC MATLAB River mixed programming, which has just started to learn the helpful)
    2006-06-08 17:21:53下载
    积分:1
  • main
    this is a new alghorithm about tabu search....
    2013-05-26 16:48:25下载
    积分:1
  • tscz
    系统包括简单的基本功能,..........................(dfjk)
    2009-11-15 13:40:04下载
    积分:1
  • matlab_rtw_c
    (1)通过Simulink创建仿真模型;(2)配置相关RTW(Real-Time Workshop)参数;(3)通过RTW(Real-Time Workshop)自动生成C代码文件,并理解主要文件、接口函数和变量的意义;(4)在Visual C++中将生成的C代码作适当修改,编译运行并分析结果。((1) created by Simulink simulation model (2) configuration related to RTW (Real-Time Workshop) parameters (3) RTW (Real-Time Workshop) automatically generate C code files, and understand the main document, interface functions and variables significance (4) Visual C++ generated C code will be modified as appropriate, compile, run and analyze the results.)
    2011-01-09 23:00:25下载
    积分:1
  • deec-VS-leach.matlab
    此代码将leach和deec协议进行比较,对毕设要坐这方面的同学很有帮助,大家有兴趣可以看看。(This code will leach and deec protocol comparison, the complete set up to take the students very helpful in this regard, we are interested can look at.)
    2014-01-20 17:27:55下载
    积分:1
  • FANYI
    关于恶意代码检测和LTE网络,4G的LTE-A网络的外语文章的翻译论文(Foreign-language article about malicious code detection and lte network, lte-a network of 4g)
    2014-01-02 18:09:59下载
    积分:1
  • main
    禁忌搜索算法解决0/1整数规划NP难问题(Tabu Search Algorithm for 0/1 integer programming problem NP hard)
    2011-01-10 10:43:56下载
    积分:1
  • McluttermatlaA
    基于MATLAB软件的有关雷达杂波的的很多个程序,相信对初学入门者很有帮助 (Based on MATLAB software on the radar clutter of many programs, I believe that is helpful for beginners beginners)
    2012-07-19 17:36:40下载
    积分:1
  • Probabilistic-Graphical-Models
    很经典的书籍哦,有1200多页,非常经典的概率图模型书籍,网上价格一般都1000多元哦!(it is very good for you!)
    2014-11-26 20:42:51下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载