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 zhaojianbo at 2010-03-27 22:37:43 on Problem 2663
讨论区里说的好混乱,我整理下
最好理解的递推式是:f[n] = f[n-2] * 4 - f[n-4] 
                 边界: f[0] = 1, f[1] = 0,f[2] = 3, f[3] = 0;
看下题目里的图就能推出这个公式。
因为n为奇数时是0所有有人讨论奇偶,递推式就变成了:
                   f[n] = f[n-1] * 4 - f[n-2] 
                边界: f[0] = 1, f[1] = 3;
注意:
(1)n为奇数时是0,不是下面那些瞎说的-1,
(2)f[0] = 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