标签:
题目描述:public class Solution { public int ClimbStairs(int n) { return Go(n + 1); } private int Go(int n) { if(n == 1 || n == 2) { return 1; } if(n%2 == 0) { var k = n/2; return Go(k) * (2*Go(k+1) - Go(k)); } else { var k = (n-1)/2; return Go(k+1) * Go(k+1) + Go(k) * Go(k); } } }
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/lan_liang/article/details/49188175