
动态规划
文章平均质量分 51
AuroraN
这个作者很懒,什么都没留下…
展开
-
最优包括(DP)
第十届蓝桥杯国赛C++B组我们称一个字符串 S 包含字符串 T 是指 T 是 S 的一个子序列,即可以从字符串 S 中抽出若干个字符,它们按原来的顺序组合成一个新的字符串与 T 完全一样。给定两个字符串 S 和 T,请问最少修改 S 中的多少个字符,能使 S 包含 T?输入格式输入两行,每行一个字符串。第一行的字符串为 S,第二行的字符串为 T。两个字符串均非空而且只包含大写英文字母。输出格式输出一个整数,表示答案。数据范围1≤|T|≤|S|≤1000输入样例:ABCDEABCDX原创 2021-06-01 15:52:35 · 469 阅读 · 0 评论 -
HDU - 1159(LCS)
Common SubsequenceA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, …, xm> another sequence Z = <z1, z2, …, zk> is a subsequence of X if there exists a strictly i原创 2021-05-26 11:46:43 · 177 阅读 · 0 评论 -
B - Palindrome
动态规划A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the minimal number of characters to be inserted into the string in原创 2020-05-23 23:18:25 · 188 阅读 · 0 评论 -
POJ - 2533(LIS)
最大上升子序列(LIS)A numeric sequence of ai is ordered if a1 < a2 < … < aN. Let the subsequence of the given numeric sequence (a1, a2, …, aN) be any sequence (ai1, ai2, …, aiK), where 1 <= i1 < i2 < … < iK <= N. For example, sequence (1,原创 2021-05-25 21:05:47 · 170 阅读 · 0 评论