码迷,mamicode.com
首页 >  
搜索关键字:dp    ( 24588个结果
HDU4508 湫湫系列故事——减肥记I
这题一开始看还以为是0,1背包问题,不过老师说过了完全背包就按照这个思路做.(虽然偷偷去百度了一下到底是不是,有点怀疑老师是不是记错了的说); 顺便记下对一维数组方程的理解; for(int i =1;i3usingnamespacestd;4inta[maxn],b[maxn],n,m,dp[m....
分类:其他好文   时间:2014-07-30 23:40:25    阅读次数:389
(转)石子合并问题
本文转自http://blog.csdn.net/acdreamers/article/details/18039073石子合并问题是最经典的DP问题。首先它有如下3种题型:(1)有N堆石子,现要将石子有序的合并成一堆,规定如下:每次只能移动任意的2堆石子合并,合并花费为新合成的一堆石子的数量。求将...
分类:其他好文   时间:2014-07-30 23:29:25    阅读次数:285
HDU 1260:Tickets(DP)
Tickets Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 923    Accepted Submission(s): 467 Problem Description Jesus, what a great ...
分类:其他好文   时间:2014-07-30 20:58:44    阅读次数:213
杭电 1176 免费馅饼
http://acm.hdu.edu.cn/showproblem.php?pid=1176 免费馅饼 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 25157    Accepted Submission(s): 852...
分类:其他好文   时间:2014-07-30 20:49:14    阅读次数:207
POJ 1141 Brackets Sequence (区间DP)
Description Let us define a regular brackets sequence in the following way: 1. Empty sequence is a regular sequence. 2. If S is a regular sequence, then (S) and [S] are both regular sequences....
分类:其他好文   时间:2014-07-30 20:44:34    阅读次数:267
HDU 1080 Human Gene Functions
最长公共子序列的变形题目大意:给出两个基因序列,求这两个序列的最大相似度。题目中的表格给出了两两脱氧核苷酸的相似度。状态转移方程为:dp[i][j] = max(dp[i-1][j]+Similarity(s1[i], '-'), dp[i][j-1]+Similarity(s2[...
分类:其他好文   时间:2014-07-30 20:33:04    阅读次数:176
codeforces159D - Palindrome pairs 二重DP
题意:给你一个字符串,问你其中不重叠的回文字串对有多少解题思路:这题用到两种方法,不过其实是一个很巧妙的二重dp1)暴力求解以i开头,j结尾的是否为回文,如果是,ans += sum[i-1](ans 为答案, sum[i]为在 1 - i内回文串的个数--需要dp求解)这里非常耗时,时间大约为 n...
分类:其他好文   时间:2014-07-30 20:05:44    阅读次数:276
测试赛B - Balance(天平的dp问题)
B - Balance Time Limit:1000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64u Submit Status Description Gigel has a strange "balance" and he wants to poise it. Actually, t...
分类:其他好文   时间:2014-07-30 17:45:24    阅读次数:271
POJ 2029 DP || 暴力
在大矩形中找一个小矩形 使小矩形包含的*最多 暴力或者DP  水题 暴力: #include "stdio.h" #include "string.h" int main() { int n,m,w,i,s,t,j,k,l,ans,sum,x,y; int map[101][101]; while (scanf("%d",&w)!=EOF) ...
分类:其他好文   时间:2014-07-30 17:44:24    阅读次数:201
[ACM] hdu 4248 A Famous Stone Collector (DP+组合)
A Famous Stone Collector Problem Description Mr. B loves to play with colorful stones. There are n colors of stones in his collection. Two stones with the same color are indistinguishable. M...
分类:其他好文   时间:2014-07-30 17:41:44    阅读次数:287
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!