给出一个森林,每棵树均为一组物品,首先推出每棵树可以组成的物品种类。
然后是基本的分组背包模板。
即 最外层枚举组数,次外层枚举背包容量,内层枚举物品体积。
对于每棵树有 ans[root][i+j] = ans[root][ i ] + ans[son][ j ]。
题水数据也水,不多说了。
#include
#include
#include
#include
#in...
分类:
其他好文 时间:
2014-07-22 23:05:52
阅读次数:
387
去网站下载mysql的yum源,地址如下:
http://repo.mysql.com/
在linux上先查看系统的版本号,根据版本号对应下载
more /etc/redhat-release
rpm -Uvh
http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
yum -y upgrade mysql
m...
分类:
数据库 时间:
2014-07-22 23:03:13
阅读次数:
472
software directory: The default directory of
software installed on ubuntu is /usr, so just allocate more space for this
partition when installing oper...
分类:
其他好文 时间:
2014-05-06 00:02:59
阅读次数:
281
1.1 Hour 1 - Understanding Windows Workflow
Foundation1.1.1 What workflow is in generalA workflow is logic-consisting of one
or more steps that are pr...
1、基础的命令ver或cmd:查看当前系统版本md/rd
hack:创建/删除目录dir:列文件more 文件:使用管道查看文件net start/stop 服务名:启动/关闭服务net stop
sharedaccess:关闭防火墙netstat -an:查看开发端口netstat -anb:查看...
The game of billiards involves two players knocking 3 balls around
on a green baize table. Well, there is more to it, but for our
purposes this is sufficient.
The game consists of several rounds ...
分类:
其他好文 时间:
2014-05-03 16:15:33
阅读次数:
296
Struts2实现文件上传
配置文件struts.xml
<!--
/*
* $Id: struts.xml 1364077 2012-07-21 12:57:02Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor licens...
分类:
其他好文 时间:
2014-05-03 15:41:44
阅读次数:
348
Artificial Intelligence?
Physics teachers in high school often think that problems given as text are more demanding than pure computations. After all, the pupils have to read and underst...
分类:
其他好文 时间:
2014-05-02 23:39:35
阅读次数:
485
题目链接:12105 - Bigger is Better
题意:一些火柴,问你能组成整除m最大的数字是多少。
思路:dp[i][j]表示用i根火柴,组成%m余数为j的最大数字,末尾多一个数字k的状态就是dp[i + num[k]][(j * 10 + k) % m],由于最多可能50位数,所以要用高精度。
注意一个优化点,由于高精度的计算上只需要乘10+k,常规的高精度乘法复杂度还是有点高...
分类:
其他好文 时间:
2014-05-01 18:22:36
阅读次数:
350
More is better
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 327680/102400 K (Java/Others)
Total Submission(s): 13119 Accepted Submission(s): 4800
Problem Description
Mr Wang ...
分类:
其他好文 时间:
2014-04-30 22:24:39
阅读次数:
285