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:我用纯dp过了,但是用备忘录却过不了,请高人看看程序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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator