| ||||||||||
| 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 | |||||||||
大水题
两个指针,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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator