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

区间dp 好理解 可是转化成lcs 这是为什么呢 求 高人指点 一二

Posted by tpgzy2012 at 2013-12-25 18:10:27 on Problem 1159
A good method to solve this problem is to determine the length L
of a longest common subsequence (maximal matching) for the input and
its reverse.  The answer then is N - L.  An alternative approach is
to match a prefix of the string with the reverse of a postfix.

The length of a longest common subsequence can be determined
by dynamic programming.  A triangular table can be constructed,
of which only two rows need to be stored.  The complexity
is then O(N) space and O(N^2) time.

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