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 |
递推公式及推导过程。先假设没2竖为1 单位。 对当前解a[i] ,有 1.在此处放一单位的积木。等于a[i-1]*3; 2.与前面相连接。连接的方案有 2 * (a[i-2] + a[i-3] +......+a[0]); a[i] = 3*a[i-1] + 2*(a[i-2] + a[i-3] +......+a[0]); a[i-1] = 3*a[i-2] + 2*(a[i-3] + a[i-3] +......+a[0]); a[i-1] - a[i-2] = 2*(a[i-2] + a[i-3] +......+a[0]); 解得a[i] = a[i-1] * 4 - a[i-2]; 至于为何要a[0] = 1,从公式中就可看到因为要一直取到最前面一个单位。这时也有2种情况。故a[0] = 1 能从理论上运算。。。。这是我的理解,见笑了。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator