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 cug_fish2008 at 2008-12-10 20:48:38 on Problem 1080
f(a,b) 代表从上下行的第a、b个元素开始的
返回 
如果上行的第a个元素和下行的第b个元素一样的话
直接返回f(a+1,b+1)+5
f(a+1,b)+t(a,_)//表示用第a个元素和‘-’来求值
f(a,a+1)+t(_,b)
f(a+1,b+1)+t(a,b)
它们中最大的一个

这样做就是动态规划嘛 怎么会超时呢?

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