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 POJLIU at 2016-10-16 18:49:51 on Problem 3280
两个指针,i,j;
F(i,j)为将S字符串的i到j位变为合法的代价
读入从0开始

For i m-1 to 1 
    For j i+1 to m-1 
    {
        F(i,j)=min(  F(i+1,j)+cost[i]  ,  F(i,j-1)+cost[j]  );
        IF(S[i]==S[j])
            F(i,j)=min(  F(i,j)  ,  F(i+1,j-1) )
    }

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