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

Re:学会了

Posted by xuning at 2007-07-01 19:27:59 on Problem 1458
In Reply To:学会了 Posted by:y05yxg at 2007-05-03 14:36:29
> res[1...len1][1...len2]
> res[i][j]保存s1[0...i-1]和s2[0...j-1]的最长公共子序列
> 
> if(s1[i-1]==s2[j-1]) res[i][j]=res[i-1][j-1]+1;
> else  res[i][j]=(res[i][j-1]>=res[i-1][j]?res[i][j-1]:res[i-1][j]);
> 
> cout<<res[len1][len2];
:)

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