该文是对dp的提高(并非是dp入门,dp入门者请先参考其他文章) 有时候dp的复杂度也有点大。。。会被卡。 这几次blog大多数会讲dp优化。 回归noip2017PJT4.(题目可以自己去百度)。就是个很好的案例。那题是个二分套dp如果dp不优化复杂度O(n^2logn)还能拿60分(CCF太仁慈 ...
分类:
其他好文 时间:
2018-02-25 00:03:03
阅读次数:
177
Big Event in HDU Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24321 Accepted Submission(s): ...
分类:
其他好文 时间:
2017-06-04 14:42:47
阅读次数:
187
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 Comp ...
分类:
其他好文 时间:
2016-11-02 23:31:57
阅读次数:
291
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 ...
分类:
编程语言 时间:
2016-04-12 20:58:07
阅读次数:
159
Big Event in HDU Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Description Nowadays, we all know that Computer College is the b
分类:
其他好文 时间:
2016-02-24 12:38:27
阅读次数:
192
题目大意:有N种东西,现已知每样东西的价值和数量,将N种东西分成两堆,且保证第一堆的价值不少于第二堆的前提下,使两堆的价值尽可能相等
解题思路:
考虑,由于第二堆的价值小于等于第一堆,也就是说第二堆的价值的最大值不能超过总价值的一般,把这个看成背包的容量,可以得到如下的状态转移方程
value[j]=max{value[j],value[j-facility[i]...
分类:
其他好文 时间:
2015-08-27 16:47:33
阅读次数:
182
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1711
这个一个字符串匹配的模板题;
其实KMP算法很好理解,但是如果初次接触的话,理解他怎么来的next数组可能会比较吃力;我这里就暂且笼统的讲一下吧。
对于我们要查询的字符串,我们先对他进行前缀和后缀的处理,保存在next数组内;比如这串数字
b[]= 1 2 3 4 1 ...
分类:
编程语言 时间:
2015-08-13 20:09:28
阅读次数:
108
描述: 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....
分类:
其他好文 时间:
2015-08-11 23:06:23
阅读次数:
212
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 absolutely a big even...
分类:
其他好文 时间:
2015-03-04 19:14:57
阅读次数:
176
题目信息:
给出一些物品的价值和个数,分成两份,是这两份的价值相差最小(DP方法)
http://acm.hdu.edu.cn/showproblem.php?pid=1171
AC代码:
/**
*0-1背包问题
*使得总背包的一半空间装尽可能多的价值
*/
#include
#include
using namespace std;
int dp[250...
分类:
其他好文 时间:
2014-10-26 19:46:28
阅读次数:
180