动态规划基础
文章平均质量分 78
Vmorish
这个作者很懒,什么都没留下…
展开
-
wustoj1889编辑距离
Description设A和B是两个字符串。我们要用最少的字符操作次数,将字符串A转换为字符串B。这里所说的字符操作共有三种:1、删除一个字符;2、插入一个字符;3、将一个字符改为另一个字符。对任的两个字符串A和B,计算出将字符串A变换为字符串B所用的最少字符操作次数。Input第一行为字符串A;第二行为字符串B;字符串A和B的长度均小于原创 2017-02-25 16:50:42 · 737 阅读 · 0 评论 -
HDU_1087 Super Jumping! Jumping! Jumping!
Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. The原创 2017-04-08 20:45:03 · 210 阅读 · 0 评论 -
HDU_1003 Max Sum
Given a sequence a11,a22,a33......ann, your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14. InputThe原创 2017-04-08 22:03:31 · 526 阅读 · 0 评论 -
UVA_1025 A Spy in the Metro(dp)
题意:有n个车站,分别编号为1-n,没亮列车从车站i到车站i+1需要花费ti的时间(其中1分析:典型的动态规划,用dp[i][j]表示时刻i车站j处的列车需要等待的时间,边界条件就是dp[T][n] = 0,dp[T][i] = INF,有三种决策:1.不上车等一分钟,此时dp[i][j] = dp[i+1][j];2.乘往右行驶的列车,此时dp[i][j] = min(dp[i][j原创 2017-04-17 21:39:48 · 226 阅读 · 0 评论 -
whu网络赛 E - Money
DESCRIPTIONKile and Pogi have found N banknotes on the street. After making sure that the original owner is nowhere to be found, they decided to split the banknotes amongst themselves. In the en原创 2017-05-14 09:58:43 · 313 阅读 · 0 评论 -
HDU - 5489 Removed Interval (dp+线段树) 2015合肥网络赛
HDU - 5489 Removed Interval (dp+线段树) 2015合肥网络赛Problem DescriptionGiven a sequence of numbers A=a1,a2,…,aN, a subsequence b1,b2,…,bk of A is referred as increasing if b1<b2<…<bk. LY has just learned how to find the longest increasing subsequence (LIS).Now转载 2017-09-13 12:55:26 · 443 阅读 · 0 评论