标签:style ar os sp for on 问题 bs ef
@求解两字串最长公共子串问题 @brief LCS PROBLEM n^2 solved @string a ‘ size is m, str b‘s size is n for i -> 1 to m for j -> 1 to n if a[i] == b[i] dp[i][j] = dp[i-1][j-1] + 1 else dp[i][j] = max(dp[i-1][j], dp[i][j-1])
@求解字串中的最长上升或不降子序列 @brief LIS PROBLEM n^2 solved @string a‘ size is n, for i-> 1 to n for j -> 1 to i - 1 if a[i] > a[j] dp[i] = max(dp[i], dp[j] + 1);
标签:style ar os sp for on 问题 bs ef
原文地址:http://my.oschina.net/u/572632/blog/345621