
动态规划
文章平均质量分 72
细水会流长
个人博客:micsay.com,微信公众号:micsaycom
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ 3254 Corn Fields [动态规划 简单状态压缩]
题干DescriptionFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. R原创 2016-07-24 19:29:14 · 339 阅读 · 0 评论 -
POJ 2955 Brackets [区间dp]
题干走你题解#include<cstdio> #include<cstring> #define max(x,y) (x) > (y) ? (x) : (y) #define min(x,y) (x) < (y) ? (x) : (y)bool equal(char s[],int i,int j){ return (s[i]== '(' && s[j] == ')') || (s[i] ==原创 2016-08-11 10:31:05 · 244 阅读 · 0 评论 -
ACM 动态规划笔记
学习资源1.瞿老师给的动态规划题目以及讲解的链接:http://blog.jobbole.com/96364/2.解决动态规划问题,要先找出动态转移方程来,动态转移方程怎么找呢?首先得定好,用哪几个因子,可以明确的表示好一个状态,然后,再通过样例或者特例或者硬想,找出子问题和父问题的关系,或者说,子问题怎么push,可以影响到父问题?我感觉可以放开思路想,放心大胆的想,假设你不会动态规划,让你暴力搜原创 2016-07-13 11:13:23 · 4814 阅读 · 0 评论 -
HDU 2196 Computer [树形dp]
题干走你题解/** *比较经典的树形dp *跑两次深搜,都是从根1开始搜索,第一次深搜获得最大子树, *第二次深搜是在第一次深搜的基础上,进行dp操作,获得最终结果 *一个结点最终的结果,可能来自于这个结点的父亲,也可能来自这个结点的儿子,而儿子在第一次深搜 *的时候就得出来了,所以应该从上往下搜出来自父亲的最大权值来决定是否再次更新 */ #include<cstdio> #include<vec原创 2016-08-10 19:04:44 · 311 阅读 · 0 评论 -
poj动态规划经典题目
列表一:经典题目题号: 容易: 1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1191,1208, 1276, 1322, 1414, 1456, 1458, 1609, 1644, 1664, 1690, 1699, 1740, 1742, 1887, 1926, 1936, 1952, 1953, 1转载 2016-08-03 23:46:07 · 929 阅读 · 0 评论 -
POJ 2184 Cow Exhibition [动态规划 01背包]
??Description“Fat and docile, big and dumb, they look so stupid, they aren’t much fun…” - Cows with Guns by Dana Lyons The cows want to prove to the public that they are both smart and fun. In orde原创 2016-08-01 15:38:58 · 264 阅读 · 0 评论 -
HDU 2639 Bone Collector II [动态规划 第k大01背包]
题干Problem Description The title of this problem is familiar,isn’t it?yeah,if you had took part in the “Rookie Cup” competition,you must have seem this title.If you haven’t seen it before,it doesn’t ma原创 2016-08-01 20:53:46 · 355 阅读 · 0 评论 -
POJ 2533 最长上升子序列 [动态规划 + 二分搜索]
题干DescriptionA numeric sequence of ai is ordered if a1 < a2 < … < aN. Let the subsequence of the given numeric sequence (a1, a2, …, aN) be any sequence (ai1, ai2, …, aiK), where 1 <= i1 < i2 < … < iK <原创 2016-07-29 15:50:17 · 330 阅读 · 0 评论 -
POJ 1837 Balance [动态规划——完全背包]
题干DescriptionGigel has a strange “balance” and he wants to poise it. Actually, the device is different from any other ordinary balance. It orders two arms of negligible weight and each arm’s length i原创 2016-07-16 11:17:05 · 370 阅读 · 1 评论 -
HDU 2089 不要62 [数位dp]
题干走你题解/** *数位dp,转移方程很好想,需要仔细考虑的是,怎样通过计算出来的dp数组 *得出结果,也就是本题目里面的work()函数,我写的有点乱,但是好在AC了 */ #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int dp[10][10]; int work(int n){原创 2016-08-12 10:37:00 · 281 阅读 · 0 评论