给定两个序列X和Y,求X和Y的最大长度公共子序列的长度。
一个序列的子序列,定义如下,选取一组严格递增的下标<i1,i2,i3,i4,……im>
则这些上标上的元素构成的新序列就是原序列的子序列,
比如序列 X = < a, b, c, f, b, c > ,选取下标 < 1, 2, 4, 6 >.后得到的序列Z=<a,b,f,c>就是X的子序列之一
The program input is from the std input. Each data set in the input contains two strings representing the given sequences. The sequences are separated by any number of white spaces. The input data are correct.
字符串长度小于等于1000
abcfbc abfcab programming contest abcd mnp
4 2 0