给出一个森林,每棵树均为一组物品,首先推出每棵树可以组成的物品种类。
然后是基本的分组背包模板。
即 最外层枚举组数,次外层枚举背包容量,内层枚举物品体积。
对于每棵树有 ans[root][i+j] = ans[root][ i ] + ans[son][ j ]。
题水数据也水,不多说了。
#include
#include
#include
#include
#in...
分类:
其他好文 时间:
2014-07-22 23:05:52
阅读次数:
387
So, the New Year holidays are over. Santa Claus and his colleagues can take a rest and have guests at last. When two "New Year and Christmas Men" meet, thear assistants cut out of cardboard the letter...
分类:
其他好文 时间:
2014-07-22 23:03:53
阅读次数:
521
hdu 1250 Hat's Fibonacci 高精度数,类似万进制...
分类:
其他好文 时间:
2014-05-01 18:26:27
阅读次数:
351
用apache来处理外界的请求,再把请求转发给wls,这样就能够突破wls express版本的5用户限制
具体配置如下
copy ${WLS_Server}/server/lib下的mod_wl_20.so到${apache_home}/modules下
修改httpd.conf文件
LoadModule weblogic_module modules\mod_wl_20.so
...
分类:
Web程序 时间:
2014-05-01 17:58:03
阅读次数:
417
题目:寻找最长上升自序列。
代码:
#include
#include
#include
#include
using namespace std;
struct node
{
int w,s; //重量,速度
int num; //编号
int t; //用来记录当前编号...
分类:
其他好文 时间:
2014-05-01 17:17:32
阅读次数:
285
冒泡排序
思路:就是每次将最大或最小的元素放到数组的最后,so easy!时间复杂度为(O(n^2))
public class BubbleSort {
public static void bubbleSort(int[] a) {
for (int j = 1; j < a.length; j++) {
for (int i = 0; i < a.length - j; i+...
分类:
编程语言 时间:
2014-04-30 22:12:40
阅读次数:
309
OJ题目 : click here ~~
题目分析:G种颜色的宝石(Gems),放在B个包里,每个包里同种宝石的个数不定哦。A,B轮流取一个包,宝石放在cooker上,同种颜色的宝石达到S个时,就可以融合成一个魔法石,如果2*S个当然就可以融合成两个魔法石啦。某人在某轮获得了魔法石,可以接着再玩一轮,直到没有获得魔法石。A先开始。问A比B 最多能多多少个魔法石。A,B都采用最优策略。
B的值最...
分类:
其他好文 时间:
2014-04-29 13:46:21
阅读次数:
278
Zhuge Liang's Mines
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1166 Accepted Submission(s): 505
Problem Description
In the ...
分类:
其他好文 时间:
2014-04-29 13:38:22
阅读次数:
368