题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1171 Big Event in HDU Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) 问题描述 Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you…
题目链接:HDOJ - 1171 题目大意 有 n 种物品,每种物品有一个大小和数量.要求将所有的物品分成两部分,使两部分的总大小尽量接近. 题目分析 令 Sum 为所有物品的大小总和.那么就是用给定的物品做完全背包,背包容量为 (Sum / 2) ,得到的结果是较小的一部分的大小. 完全背包问题可以使用单调队列优化,O(nm) . 代码 #include <iostream> #include <cstdio> #include <cstdlib> #include…
Big Event in HDU Problem Description Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into Computer College and Software College in 2002.The splitting is…
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 40976 Accepted Submission(s): 14090 Problem Description Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe yo…
Big Event in HDU Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 27961    Accepted Submission(s): 9847 Problem Description Nowadays, we all know that Computer College is the biggest department…
B - Big Event in HDU Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into Computer College and Software College in 2002. The splitting is absolutely a b…
Big Event in HDU Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 51181    Accepted Submission(s): 17486 Problem DescriptionNowadays, we all know that Computer College is the biggest department…
Big Event in HDU Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 38607    Accepted Submission(s): 13362 Problem Description Nowadays, we all know that Computer College is the biggest department…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1171 题意:把商品分成两半,如不能均分,尽可能的让两个数相接近.输出结果:两个数字a,b且a>=b. 思路:01背包. 先把商品的总价值计算出来,sum/2做为背包的容量. 然后讲同种商品的多件,存储为不同商品 同样价值的形式,也就是我们用一个一维数组来存储,不用一个二维或是两个一维数组来存. 感想:好久没有做背包的题目了,今天来做,忘了好多思路,这提醒着我,学习不能一直都在学新东西,也要及时的复习.…
题目地址:HDU 1171 还是水题. . 普通的01背包.注意数组要开大点啊. ... 代码例如以下: #include <iostream> #include <cstdio> #include <string> #include <cstring> #include <stdlib.h> #include <math.h> #include <ctype.h> #include <queue> #incl…