http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=944区间dp,对于每段区间,他们的最优值都是由几段更小区间的最优值得到,是分治思想的一种应用,将一个区间问题...
分类:
其他好文 时间:
2014-10-09 19:31:57
阅读次数:
137
Sky Soldiers
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 559 Accepted Submission(s): 181
Problem Description
An airplane carried...
分类:
其他好文 时间:
2014-10-03 00:08:13
阅读次数:
182
1479: Treasure Chest Lock
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 7 Solved: 5
[Submit][Status][Web
Board]
Description
Vic has a treasure chest. And there is a lock on the treasure c...
分类:
其他好文 时间:
2014-10-01 17:40:21
阅读次数:
187
Blocks
Time Limit: 5000MS
Memory Limit: 65536K
Total Submissions: 4250
Accepted: 1704
Description
Some of you may have played a game called 'Blocks'. There are n bloc...
分类:
其他好文 时间:
2014-09-28 22:22:45
阅读次数:
396
题目:计算最长的等差数列长度。
分析:dp,LIS类似物,二分。先排序,然后枚举前面的所有点作为前一个元素求公差即可。
更新时,利用二分找到,距离当前位置最近的前第二元素,
如果不存在,则直接更新为 2即可。
说明:如果数据范围小的话,可在连续区间dp(O(L^2))。(2011-10-03 17:34)
#include
#inclu...
分类:
其他好文 时间:
2014-09-26 01:29:48
阅读次数:
372
Sky Soldiers
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 556 Accepted Submission(s): 179
Problem Description
An airplane car...
分类:
其他好文 时间:
2014-09-25 18:28:57
阅读次数:
274
大意:告诉你n个矩阵的行数和列数比如说32 3 4 5代表有3个矩阵第一个矩阵2 * 3 第二个矩阵 3 * 4 第三个矩阵4 * 5 并且知道只有连续的矩阵才可以相乘问最后相乘的次数最少是多少分析:用区间dp可以做每次递归调用的时候枚举每个分割点最后加上附带的价值即可代码: 1 #include ...
分类:
其他好文 时间:
2014-09-19 21:06:26
阅读次数:
246
Description
Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Halloween, these
parties are all cos...
分类:
其他好文 时间:
2014-09-19 12:05:05
阅读次数:
183
Description
You want to hold a party. Here's a polygon-shaped cake on the table. You'd like to cut the cake into several triangle-shaped parts for the invited comers. You have a knife to cut. The t...
分类:
其他好文 时间:
2014-09-18 23:48:44
阅读次数:
314
题目:uva 10003 Cutting Sticks
题意:给出一根长度 l 的木棍,要截断从某些点,然后截断的花费是当前木棍的长度,求总的最小花费?
分析:典型的区间dp,其实和石子归并是一样的,花费就是石子的和,那么久不用多说了。
AC代码:
#include
#include
#include
#include
#include
#include
#in...
分类:
其他好文 时间:
2014-09-18 18:53:24
阅读次数:
201