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:HINT说不能用递归,可是为什么啊?

Posted by united at 2009-11-11 20:41:17 on Problem 2696 and last updated at 2009-11-11 20:41:44
In Reply To:Re:HINT说不能用递归,可是为什么啊? Posted by:Go_always at 2007-11-22 01:43:13
这么说吧,假如定义递归函数 f(i) 来做的话,求 f(10)的时候要会把f(9),f(8),f(7)分别求
一遍。求f(9)的时候呢又要将 f(8),f(7),f(6)分别求一遍,这样的话 f(8),f(7)就已经重
复求解了。假如我们要求f(1000),那么重复的次数就多到不可忍受了。 所以我们应该从前往
后求, 将求得的结果都存在一个数组里面。

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