dp
古语.
这个作者很懒,什么都没留下…
展开
-
POJ - 3280 dp
AP现在定义两个字符串操作。操作1:在任意位置添加一个字符char(只有小写字母),并花费a[char-'a']元操作2:在任意位置删除一个字符char(只有小写字母),并花费b[char-'a']元现在给你一个字符串S,问最少消耗多少花费使其变成回文串。Input第一行,两个整数由空格分开:N和M (1 ≤ M ≤ 2,000) (1 ≤ N ≤ 26)第二行,长度为M的字...原创 2020-04-10 22:28:04 · 176 阅读 · 0 评论 -
HDU - 4722(初学数位dp)
If we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number.You are required to count the number of good numbers in the range from A to B, i...原创 2019-04-01 16:32:09 · 158 阅读 · 0 评论 -
Max sum(简单dp)
Given a sequence a[1],a[2],a[3]......a[n], 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...原创 2019-03-25 21:25:36 · 152 阅读 · 0 评论