
子序列
文章平均质量分 72
tian_he_he
GeeGee
展开
-
hdu【1159】Common Subsequence 【最长公共子序列】
Common SubsequenceA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if ther原创 2017-08-08 16:45:13 · 327 阅读 · 0 评论 -
hpu暑假训练【最长公共子序列&&回溯输出】
/*LCS输入BDCABA ABCBDAB求最长公共子序列并输出这个子序列 子串:连续子序列:可以不连续 dp[i][j]//第一个字符串在第i个字符前且第二个串在第j个字符前可构成的最长子序列的长度 dp[i][j] = 0 i=0 || j=0 dp[i-1][j-1]+1 str1[i]==str2[j] max(dp[i-原创 2017-08-08 17:12:29 · 271 阅读 · 0 评论 -
hpu暑假训练 A - 最少拦截系统【LIS】
某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹. 怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里来求救了,请帮助计算一下最少需要多少套拦截系原创 2017-08-09 15:11:36 · 243 阅读 · 0 评论 -
hpu暑假训练 B - Bridging signals 【LIS】
'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making the signals on the chip connecting the ports原创 2017-08-09 16:02:37 · 253 阅读 · 0 评论 -
hdu5256【序列变换】【LIS】
Description我们有一个数列A1,A2...An,你现在要求修改数量最少的元素,使得这个数列严格递增。其中无论是修改前还是修改后,每个元素都必须是整数。 请输出最少需要修改多少个元素。Input第一行输入一个T (1 每一组数据: 第一行输入一个N (1 第二行输入N个数A_1, A_2, ..., A_n。 每一个数列中的元素都是正整数而且原创 2017-08-15 16:11:06 · 284 阅读 · 0 评论