登录
首页 » Visual C++ » 0

0

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

  • win-iotest
    并口类别控制类库源码,可以方便的实现对并口的控制操作(type library source, to facilitate the realization of the parallel port control operation)
    2006-08-10 15:52:00下载
    积分:1
  • polyphase
    这个是多相滤波的MATLAB程序,做接收机的同学可以参考的(this is a polyphase programme)
    2013-11-06 20:01:53下载
    积分:1
  • matlab
    matlab 教程(matlab tutorial)
    2010-05-06 22:55:51下载
    积分:1
  • Attachments_20131118
    OPTICAL COMMUNICATION OPTICAL COMMUNICATIONS
    2013-11-28 23:41:19下载
    积分:1
  • srchybrid45b_VeryCD
    电骡0.45b源码.rar (-- Mule 0.45b source. Rar-- Mule 0.45b source. Rar)
    2007-01-21 13:07:10下载
    积分:1
  • PSO
    梯度下降法是最早最简单,也是最为常用的最优化方法。梯度下降法实现简单,当目标函数是凸函数时,梯度下降法的解是全局解。一般情况下,其解不保证是全局最优解,梯度下降法的速度也未必是最快的。梯度下降法的优化思想是用当前位置负梯度方向作为搜索方向,因为该方向为当前位置的最快下降方向,所以也被称为是”最速下降法“。最速下降法越接近目标值,步长越小,前进越慢。(The gradient descent method is the earliest and most simple and most commonly used optimization method. The gradient descent method is simple to realize. When the objective function is a convex function, the solution of the gradient descent method is a global solution. In general, the solution is not guaranteed to be the global optimal solution, and the gradient descent method is not necessarily the fastest. The optimization idea of gradient descent method is to use the current position negative gradient direction as the search direction, because the direction is the fastest descending direction of the current position, so it is also called the steepest descent method. The faster the slowest descent approach is closer to the target, the smaller the step, the slower the progress.)
    2018-01-29 21:44:10下载
    积分:1
  • ranking
    约瑟夫环实验: 程序利用顺序表实现约瑟夫环,本实验是用于一个小游戏(Josephus experiment : the use of procedures to achieve the order table Josephus, the experiment is for a small game)
    2006-06-05 13:08:34下载
    积分:1
  • Knight2
    这是自己写的骑士巡游问题的源代码,控制台实现没有图形化(This is, the parade was the Knights of the source code, not realizing console Graphic)
    2006-12-05 21:41:59下载
    积分:1
  • LMS321
    LMS算法仿真,通过matlab仿真LMS算法的收敛速度(lms)
    2010-05-28 09:58:31下载
    积分:1
  • matlab_vc_combination
    该程序在VC中完成了与matlab的混合编程,用vc调用matlab中的绘图函数。(The program completed in VC mixed with matlab programming, matlab call with vc the drawing function.)
    2009-04-23 11:19:11下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载