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 y05yxg at 2007-05-03 14:36:29 on Problem 1458
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