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

Re:我用纯dp过了,但是用备忘录却过不了,请高人看看程序

Posted by wuyongdong at 2010-06-25 14:23:22 on Problem 1141
In Reply To:我用纯dp过了,但是用备忘录却过不了,请高人看看程序 Posted by:newbee007 at 2009-08-22 21:00:35
if(dist>DP(i+1,j-1)+2)
{
    dist=state[i+1][j-1]+2;
    ans[i][j]=str[i]+ans[i+1][j-1]+str[j]
}

这一段有问题,应该判断一下(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