最长公共子序列-jobdu-1402(附带打印)

简介: jobdu-1042:Coincidence 时间限制:1 秒 内存限制:32 兆 题目描述: Find a longest common subsequence of two strings. 输入: First and second line of each input case contain two strings of lowercase character a

jobdu-1042:Coincidence


时间限制:1 秒
内存限制:32 兆

题目描述:
Find a longest common subsequence of two strings.

输入:
First and second line of each input case contain two strings of lowercase character a…z. There are no spaces before, inside or after the strings. Lengths of strings

do not exceed 100.

输出:
For each case, output k – the length of a longest common subsequence in one line.

样例输入:
abcd
cxbydz
样例输出:
2
来源:
2008年上海交通大学计算机研究生机试真题
微笑最长公共子序列

 打印:

 

目录
相关文章
|
4月前
leetcode-521:最长特殊序列 Ⅰ
leetcode-521:最长特殊序列 Ⅰ
38 0
|
3月前
|
机器学习/深度学习 人工智能 JavaScript
技术心得记录:最长公共子序列(LCS)详解+例题模板(全)(转)
技术心得记录:最长公共子序列(LCS)详解+例题模板(全)(转)
|
4月前
leetcode代码记录(最长递增子序列
leetcode代码记录(最长递增子序列
23 1
|
4月前
|
索引
leetcode代码记录(最长公共子序列
leetcode代码记录(最长公共子序列
22 0
|
10月前
|
算法
代码随想录算法训练营第五十二天 | LeetCode 300. 最长递增子序列、674. 最长连续递增序列、718. 最长重复子数组
代码随想录算法训练营第五十二天 | LeetCode 300. 最长递增子序列、674. 最长连续递增序列、718. 最长重复子数组
44 1
|
11月前
|
算法
【算法挨揍日记】day05——209. 长度最小的子数组、3. 无重复字符的最长子串
题目描述: 给定一个含有 n 个正整数的数组和一个正整数 target 。 找出该数组中满足其总和大于等于 target 的长度最小的 连续子数组 [numsl, numsl+1, ..., numsr-1, numsr] ,并返回其长度。如果不存在符合条件的子数组,返回 0 。
350 0
|
算法
【力扣】第354场周赛 (最长合法子字符串的长度)
【力扣】第354场周赛 (最长合法子字符串的长度)
84 0
|
机器学习/深度学习 人工智能 算法
代码随想录训练营day52| 300.最长递增子序列 674. 最长连续递增序列 718. 最长重复子数组...
代码随想录训练营day52| 300.最长递增子序列 674. 最长连续递增序列 718. 最长重复子数组...
|
算法 C++ Python
每日算法系列【LeetCode 424】替换后的最长重复字符
每日算法系列【LeetCode 424】替换后的最长重复字符
代码随想录刷题|LeetCode 300.最长递增子序列 674. 最长连续递增序列 718. 最长重复子数组
代码随想录刷题|LeetCode 300.最长递增子序列 674. 最长连续递增序列 718. 最长重复子数组
代码随想录刷题|LeetCode 300.最长递增子序列 674. 最长连续递增序列 718. 最长重复子数组