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 |
Re:学会了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator