Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
雁过留声——记忆化搜索经典比较经典的dp了 可以用记忆化搜索,好写又快 f(i,j) if dp[i][j]!=-1 return dp[i][j] if i=0 and j=0 return dp[i][j]=1 if i>0 and the ith item of s1 matches the i+jth item of s3 if f(i-1,j) return dp[i][j]=1 the same to j and s2 return dp[i][j]=0 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator