-
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)
- 2009-07-01 23:07:01下载
- 积分:1
-
GraphSearch
用 MFC 做界面的路径搜索算法,其中包含了 深度,广度,dijistra 三者,希望大家喜欢~~~ 谢谢大家给予意见哈(Interface to do with MFC path search algorithm, which contains the depth, breadth, dijistra three, hope you like ~ ~ ~)
- 2011-06-15 06:32:07下载
- 积分:1
-
C_PL0
用C语言实现的PL0的源代码,并进行了扩展,包括文档,有助于学编译(Achieved with C language source code PL0 and expanded, including documentation, help to learn to compile)
- 2007-09-28 12:27:56下载
- 积分:1
-
NetDebug
1、实现多个网络调试助手示例在一个进程中启动;
2、可以实现TCP_SERVER,TCP_CLIENT,UDP,UDP组播通信;(1, multiple network example debugging assistant to start a process 2, can achieve TCP_SERVER, TCP_CLIENT, UDP, UDP Multicast communication )
- 2013-01-28 17:35:58下载
- 积分:1
-
dianhuaben
这是一个电话本的程序,可进行电话查询
可以参考一下(A phone book program)
- 2012-12-28 17:32:59下载
- 积分:1
-
keyboard
键盘记录源码,更加底层的键盘记录程序。通过Hook API来截获键盘记录。(The keyboard, the bottom of the source record more keylogger. Through the Hook the API to intercept the keyboard records.)
- 2011-08-30 15:08:06下载
- 积分:1
-
DrawCircle
实现画圆,用C++的mfc功能,这个是c语言交互式绘图的必备!(Achieve Circle)
- 2013-12-20 00:20:37下载
- 积分:1
-
GSRS
非常仔细的GS算法,用于RS解码过程。是KV算法的基础。包含很多例子。不可多得的关于RS码的资料(Very carefully the GS algorithm, for the RS decoding process. KV algorithm is the foundation. Contains many examples. Invaluable information on the RS code)
- 2021-05-14 06:30:02下载
- 积分:1
-
paihang
有2*n个盒子排成一行,其中有两个相邻的空盒,有n-1个盒子有符号 A ,有n-1个盒子有符号 B 。例如,n=5,并有初始配置如下:
A B B A . . A B A B
(2* n box row, wherein there are two adjacent empty box, n-1 of a box with the symbol ' A' , the symbol ' B' n-1 th box. For example, n = 5, and the initial configuration is as follows: ABBA .. ABAB)
- 2013-02-25 18:43:03下载
- 积分:1
-
computer-graphics-curriculum-design
本程序是计算机图形学课程设计的程序,包含用各种算法绘制直线、圆、曲线,填充,剪裁等,有助于计算机图形学的学习与实践。(This procedure is a computer graphics curriculum design process, including the use of various algorithms to draw lines, circles, curves, filling, cutting, etc., help to learn and practice of computer graphics.)
- 2013-10-27 16:36:07下载
- 积分:1