HDU 1159 - Common Subsequence
Problem : Given two strings, given the length of longest common subsequence.
Solution : Let f[i][j] to be the answer of prefix of s1 with length i and prefix of s2 with length j. Then if s1[i]=s2[j], f[i][j]=f[i-1][j-1]+1. Otherwise f[i][j]=max(f[i-1][j], f[i][j-1]).