![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DP
Melicent1
这个作者很懒,什么都没留下…
展开
-
1poj1836(和合唱队列一样)
http://poj.org/problem?id=1836AlignmentTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 9110Accepted: 2859DescriptionIn the army, a platoon iscomposed by n soldiers. During原创 2013-05-30 10:55:15 · 1798 阅读 · 0 评论 -
1(好好理解)poj1837(01背包)
http://poj.org/problem?id=1837BalanceTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 7171Accepted: 4321DescriptionGigel has a strange "balance"and he wants to poise it. Ac原创 2013-05-30 10:55:10 · 582 阅读 · 0 评论 -
1poj3176(dp)记忆化搜索
http://poj.org/problem?id=3176Cow BowlingTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 10719Accepted: 7017DescriptionThe cows don't use actualbowling balls when they go原创 2013-05-30 10:55:22 · 468 阅读 · 0 评论 -
poj1887(最长下降子序列)
http://poj.org/problem?id=1887Testing the CATCHERTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 12580Accepted: 4567DescriptionA military contractor for theDepartment of D原创 2013-05-30 10:57:51 · 602 阅读 · 0 评论 -
poj1050(DP)
http://poj.org/problem?id=1050To the MaxTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 31034Accepted: 16113DescriptionGiven atwo-dimensional array of positive and negativ原创 2013-05-30 10:50:31 · 424 阅读 · 0 评论 -
poj2533(DP)(与杭电1257一模一…
Longest Ordered SubsequenceTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 22202Accepted: 9565DescriptionA numeric sequence ofai is ordered if a1a2 < ...aN. Let the subse原创 2013-05-30 10:50:38 · 499 阅读 · 0 评论 -
HDOJ2602(DP0-1背包)
http://acm.hdu.edu.cn/showproblem.php?pid=2602Bone CollectorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K(Java/Others)Total Submission(s): 11339 Accepted Submission(s):4370原创 2013-05-30 10:50:40 · 695 阅读 · 0 评论 -
hdoj动态规划题集(转载)
转自:http://stevechiucn.blog.163.com/blog/static/13867751720107209937370/ DP一直是我的盲点,仅仅接触过两道最简单的DP,从来没有系统学习和总结过DP题目,以下是HDU上的46道DP题状态转移方程,供以后系统学习DP用无法考证原作者是谁,故不注明转载位置1.Robberieshttp://acm.hdu.edu原创 2013-05-30 10:50:52 · 2538 阅读 · 0 评论 -
uva10130解题报告
Root :: Contest Volumes :: Volume CI10130 - SuperSaleTime limit: 3.000 secondsRoot :: Contest Volumes :: Volume CI SuperSaleThere is a SuperSale in a SuperHiperMarket. E原创 2013-05-30 10:50:55 · 535 阅读 · 0 评论 -
(未完全)uva624
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=8&page=show_problem&problem=565这题挺好的,是典型的0-1背包问题,只不过价值()与花费(时长)是一样的。这题我还有一个地方没处理,把所选的花费(时长)也输出,时间原因我先放一下。#include#incl原创 2013-05-30 10:50:57 · 571 阅读 · 0 评论 -
poj1579
http://poj.org/problem?id=1579Function Run FunTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 12822Accepted: 6673DescriptionWe all love recursion! Don'twe?Consider a thr原创 2013-05-30 10:51:34 · 507 阅读 · 0 评论 -
最长上升子序列(转载)
http://blog.csdn.net/chenwenshi/article/details/6027086问题描述一个数的序列bi,当b1 < b2 < ...< bS的时候,我们称这个序列是上升的。对于给定的一个序列(a1, a2, ...,aN),我们可以得到一些上升的子序列(ai1, ai2, ..., aiK),这里1 <= i1< i2 < ... < iK<= N。比如原创 2013-05-30 10:55:13 · 485 阅读 · 0 评论 -
1poj2533(最长上升子序列)
http://poj.org/submit?problem_id=2533Longest OrderedSubsequenceTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 23801Accepted: 10301DescriptionA numeric sequence ofai is o原创 2013-05-30 10:55:18 · 560 阅读 · 0 评论 -
poj1458(DP最长连续公共子序列)
记住动态方程就好了。。还一个问题就是这题的dp[][]数组不能开太大我一直开的是dp[1010][1010]一直WA就是不知道原因,把这个问题改成dp[1010][101]就行了。。无语。。#include#includechar s1[1010],s2[1010];int dp[1010][101];int max(int x,int y){ return x>y?x:y;}原创 2013-05-30 10:57:47 · 566 阅读 · 0 评论 -
1poj3624(01背包)
http://poj.org/problem?id=3624Charm BraceletTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 13207Accepted: 6022DescriptionBessie has gone to the mall's jewelry store and原创 2013-05-30 10:55:08 · 501 阅读 · 0 评论 -
poj1157
http://poj.org/problem?id=1157LITTLE SHOP OF FLOWERSTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 14050Accepted: 6467DescriptionYou want to arrange the windowof your flo原创 2013-05-30 10:50:50 · 588 阅读 · 0 评论 -
poj1742andHDOJ2844(DP多重背包)
http://poj.org/problem?id=1742CoinsTime Limit: 3000MSMemory Limit: 30000KTotal Submissions: 22094Accepted: 7513DescriptionPeople in Silverland usecoins.They have coins of value A1,原创 2013-05-30 10:50:42 · 650 阅读 · 0 评论 -
0.95poj2184(变化的0-1背包太好了)
http://poj.org/problem?id=2184Cow ExhibitionTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 6753Accepted: 2366Description"Fat and docile, big and dumb,they look so stupid,原创 2013-05-30 10:56:46 · 763 阅读 · 0 评论 -
poj1700andpoj3404
Crossing RiverTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 8215Accepted: 3036DescriptionA group of N people wishes to goacross a river with only one boat, which can at m原创 2013-05-30 10:50:25 · 487 阅读 · 0 评论 -
合唱队列
合唱队列其实就是杭电1257最少拦截系统只不过在加一个逆序就是了做这题建议先把杭电1257做一下。。#includeint a[10010],b1[10010],b2[10010];int main(){ int i,j,n,max; while(scanf("%d",&n)!=EOF) { for(i=0;i scanf("%d",&a[i]);//输入数据 //b1原创 2013-05-30 10:50:27 · 1180 阅读 · 0 评论 -
(DP)最大子段和问题分析和总结(…
转载自http://www.cnblogs.com/shihao/archive/2012/01/18/2325562.html最大子段和问题分析和总结最大子段和问题(Maximum IntervalSum) 经典的动态规划问题,几乎所有的算法教材都会提到.本文将分析最大子段和问题的几种不同效率的解法,以及最大子段和问题的扩展和运用.一.问题描述给定长度为n的整数序列,a[1...n原创 2013-05-30 10:50:29 · 1232 阅读 · 0 评论 -
poj1163(DP)and3176(DP)多串的…
http://poj.org/problem?id=3176Cow BowlingTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 10012Accepted: 6594DescriptionThe cows don't useactual bowling balls when they go原创 2013-05-30 10:50:35 · 445 阅读 · 0 评论 -
poj1276(DP多重背包)
http://poj.org/problem?id=1276Cash MachineTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 18966Accepted: 6599DescriptionA Bank plans to install amachine for cash withdrawa原创 2013-05-30 10:50:44 · 498 阅读 · 0 评论 -
poj1083
http://poj.org/problem?id=1083Moving TablesTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 20134Accepted: 6580DescriptionThe famous ACM(Advanced Computer Maker) Company ha原创 2013-05-30 10:50:48 · 1284 阅读 · 0 评论 -
1poj1260(dp)
http://poj.org/problem?id=1260PearlsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 5695Accepted: 2727DescriptionIn Pearlania everybody is fondof pearls. One company, call原创 2013-05-30 10:55:20 · 456 阅读 · 0 评论 -
1poj1080(dp)
http://poj.org/problem?id=1080Human Gene FunctionsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 13883Accepted: 7678DescriptionIt is well known that a humangene can be co原创 2013-05-30 10:55:24 · 466 阅读 · 0 评论 -
1poj1159(dp)
http://poj.org/problem?id=1159PalindromeTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 43110Accepted: 14686DescriptionA palindrome is a symmetrical string, that is, astri原创 2013-05-30 10:55:26 · 431 阅读 · 0 评论 -
poj1050(dp最大子矩阵)
http://poj.org/problem?id=1050To the MaxTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 32881Accepted: 17205DescriptionGiven a two-dimensional array ofpositive and negativ原创 2013-05-30 10:57:39 · 633 阅读 · 0 评论 -
poj1125(floyd最短路)
A- Stockbroker GrapevineLimit:1000MSMemory Limit:10000KB 64bitIO Format:%I64d &%I64uSubmitStatusAppoint description: System Crawler(2012-07-20)DescriptionStockbrokers areknown to ove原创 2013-05-30 10:57:43 · 465 阅读 · 0 评论 -
poj1159(回文字串)
PalindromeTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 41514Accepted: 14146DescriptionA palindrome is a symmetricalstring, that is, a string read identically from left t原创 2013-05-30 10:50:33 · 656 阅读 · 0 评论 -
poj1953
代码1:AC#include#include#define maxn 1010int a[maxn]={0,2,3,5};int main(){ int t; int count=0; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); int i; for(i=3;i a[i]=a[i-1]+a[原创 2013-05-30 10:57:49 · 846 阅读 · 0 评论