DP
骑马看骆驼a
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU-2084 数塔(简单DP)
Problem Description 在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? 已经告诉你了,这是个DP的题目,你能AC吗? Input 输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 <= N <= 100)...原创 2018-10-09 20:28:17 · 245 阅读 · 0 评论 -
HDU-1506 Largest Rectangle in a Histogram(单调栈,DP)
Largest Rectangle in a Histogram Sample Input 7 2 1 4 5 1 3 3 4 1000 1000 1000 1000 0 Sample Output 8 4000 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1506 题意: 求直方图中最大的矩形面积 思路: 有两种解法,个人感觉DP稍简单一点...原创 2018-11-25 20:48:09 · 431 阅读 · 0 评论 -
POJ-3186 Treats for the Cows(区间dp)
Treats for the Cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8739 Accepted: 4570 Description FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get ...原创 2019-04-05 19:18:29 · 272 阅读 · 0 评论 -
POJ-1050 To the Max(最大子矩阵和)
To the Max Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 54953 Accepted: 29070 Description Given a two-dimensional array of positive and negative integers, a sub-rectangle is ...原创 2019-05-22 20:32:06 · 414 阅读 · 0 评论 -
最短Hamilton路径(二进制状态压缩+dp)
最短Hamilton路径 给定一张 nn 个点的带权无向图,点从 0~n-1 标号,求起点 0 到终点 n-1 的最短Hamilton路径。 Hamilton路径的定义是从 0 到 n-1 不重不漏地经过每个点恰好一次。 输入格式 第一行输入整数n。 接下来n行每行n个整数,其中第i行第j个整数表示点ii到jj的距离(记为a[i,j])。 对于任意的x,y,z,数据保证 a[x,x]=0,a[x,...原创 2019-05-17 17:16:08 · 436 阅读 · 0 评论 -
POJ-2288 Islands and Bridges(二进制状态压缩+DP)
Islands and Bridges Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 13134 Accepted: 3487 Description Given a map of islands and bridges that connect these islands, a Hamilton pa...原创 2019-05-17 21:42:35 · 307 阅读 · 0 评论 -
2019上海网络赛(J)Stone gameDP背包
CSL loves stone games. He has n stones; each has a weight ai. CSL wants to get some stones. The rule is that the pile he gets should have a higher or equal total weight than the rest; however if he re...原创 2019-09-18 19:48:12 · 408 阅读 · 0 评论 -
2019沈阳网络赛(C)Dawn-K's water完全背包
Dawn-K recently discovered a very magical phenomenon in the supermarket of Northeastern University: The large package is not necessarily more expensive than the small package. On this day, Dawn-K came...原创 2019-09-21 21:26:33 · 413 阅读 · 0 评论
分享