| ||||||||||
| 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 | |||||||||
本题注意的地方:讨论区里说的好混乱,我整理下
最好理解的递推式是: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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator