题目大意:给定两个字符串,求其最大的公共子串。在这里子串的定义是:Given a sequence X = < x1, x2, ..., xm > ,another sequence Z = < z1, z2, ..., zk > is a subsequence of X if there exists a strictly increasing sequence < i1, i2, ..., ik > of indices of X such that for all j = 1,2,...,k, xij = zj. For example, Z = < a, b, f, c > is a subsequence of X = < a, b, c, f, b, c > with index sequence < 1, 2, 4, 6 >.
分析:简单DP
if(first[i]=second[j]) //在最大公共子串中,first[i]和second[j]恰好配对
count[i][j]=count[i-1][j-1]+1;
else count[i][j]=max(count[i-1][j],count[i][j-1]); //否则