最大连续子序列和
dp[i] = max(dp[i - 1] + nums[i], nums[i])
最长上升子序列
dp[i] = max(1, dp[j] + 1) (j = 0...i - 1 && nums[j] < nums[i])
最长公共子序列
if (A[i] == B[j])
dp[i][j] = dp[i - 1][j - 1] + 1;
else
dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
最长回文子串
if (S[i] == S[j])
dp[i][j] = dp[i + 1][j - 1]
else
dp[i][j] = 0;
最长回文子序列
if (S[i] == S[j])
dp[i][j] = dp[i + 1][j - 1] + 2;
else
dp[i][j] = max(dp[i + 1][j], dp[i][j - 1]);