DP
一种坚持__
这个作者很懒,什么都没留下…
展开
-
100个动规方程
100个动规方程 1. 资源问题1 -----机器分配问题 F[I,j]:=max(f[i-1,k]+w[i,j-k]) 2. 资源问题2 ------01背包问题 F[I,j]:=max(f[i-1,j-v]+w,f[i-1,j]); 3. 线性动态规划1 -----朴素最长非降子序转载 2015-01-30 21:39:36 · 551 阅读 · 0 评论 -
POJ 1836 Alignment( LIS )
Alignment Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 13581 Accepted: 4369 Description In the army, a platoon is composed by n soldiers. During the mor原创 2015-01-21 19:24:28 · 586 阅读 · 0 评论 -
POJ 1260 Pearls(DP)
Pearls Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 7545 Accepted: 3733 Description In Pearlania everybody is fond of pearls. One company, called The Ro原创 2015-01-21 15:02:41 · 544 阅读 · 0 评论 -
POJ 3267 The Cow Lexicon( DP~去掉最少字符)
The Cow Lexicon Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 8319 Accepted: 3931 Description Few know that the cows have their own dictionary with W (1原创 2015-01-22 14:57:42 · 505 阅读 · 0 评论 -
POJ 1887 Testing the CATCHER(最长递减子序列)
Testing the CATCHER Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 15313 Accepted: 5633 Description A military contractor for the Department of Defense ha原创 2015-01-22 15:43:45 · 464 阅读 · 0 评论 -
POJ 1080 Human Gene Functions(LCS变形)
Human Gene Functions Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 17443 Accepted: 9707 Description It is well known that a human gene can be considered原创 2015-01-21 08:59:28 · 498 阅读 · 0 评论 -
POJ 3176 Cow Bowling(数字三角形求最值)
Cow Bowling Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14397 Accepted: 9567 Description The cows don't use actual bowling balls when they go bowling.原创 2015-01-21 09:48:05 · 562 阅读 · 0 评论 -
POJ 1159 Palindrome(LCS~~回文)
Palindrome Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 54092 Accepted: 18689 Description A palindrome is a symmetrical string, that is, a string read i原创 2015-01-20 19:54:22 · 488 阅读 · 0 评论 -
POJ 1088 滑雪(DP)
滑雪 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 79201 Accepted: 29452 Description Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等原创 2015-01-20 10:27:27 · 580 阅读 · 0 评论 -
最长上升子序列nlogn算法(poj 2533 && SDUT 1299)
这题目是经典的DP题目,也可叫作LIS(Longest Increasing Subsequence)最长上升子序列 或者 最长不下降子序列。很基础的题目,有两种算法,复杂度分别为O(n*logn)和O(n^2) 。 A. O(n^2)算法分析如下: (a[1]...a[n] 存的都是输入的数) 1、对于a[n]来说,由于它是最后一个数,所以当从a[n]开始查找时,只存在长度为转载 2015-01-19 20:19:27 · 738 阅读 · 0 评论 -
SDUT 2080 最长公共子序列问题 (同uva10100 && POJ 1458 && HDU 1159)
最长公共子序列问题 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 给定两个序列X= 输入 输入数据有多组,每组有两行 ,每行为一个长度不超过500的字符串(输入全是大写英文字母(A,Z)),表示序列X和Y。 输出 每组输出一行,表示所求得的最长公共子序列的原创 2015-01-19 16:22:37 · 766 阅读 · 0 评论 -
SDUT 2857 艺术联合会(DP)
艺术联合会 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 艺术联合会顾名思义就是n个画家用n种颜色一起进行艺术创作(作画)。每一位画家仅使用一种颜色,并且规定n位画家使用的颜色是不同的,这里我们可以假设第一位画家使用的颜色编号为1,第2位画家使用的颜色编号为2以此类推。每一幅画上面都有原创 2015-02-03 15:51:53 · 635 阅读 · 0 评论 -
uva 147 Dollars(完全背包)
Dollars Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu Submit Status Description Dollars New Zealand currency consis原创 2015-01-19 10:31:08 · 516 阅读 · 0 评论 -
uva 10534 Wavio Sequence (最大递增和递减序列 n*logn)
Wavio Sequence Input: Standard Input Output: Standard Output Time Limit: 2 Seconds Wavio is a sequence of integers. It has some interesting properties. · Wavio is of odd length i.e. L = 2*n原创 2015-01-20 15:48:57 · 626 阅读 · 0 评论 -
uva 10100 Longest Match(最长公共子序列)
Longest Match Input: standard input Output: standard output A newly opened detective agency is struggling with their limited intelligence to find out a secret information passing technique among原创 2015-01-19 15:53:50 · 1544 阅读 · 0 评论 -
POJ 1631 Bridging signals(最长上升子序列 n*logn && POJ 3903)
Bridging signals Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 11025 Accepted: 6043 Description 'Oh no, they've done it again', cries the chief designer原创 2015-01-19 20:43:37 · 590 阅读 · 0 评论 -
POJ 2241 The Tower of Babylon(dp)
The Tower of Babylon Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2292 Accepted: 1288 Description Perhaps you have heard of the legend of the Tower of B原创 2015-07-04 15:49:30 · 354 阅读 · 0 评论