Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

雁过留声——记忆化搜索经典

Posted by fanhqme at 2009-07-17 21:01:58 on Problem 2192
比较经典的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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator