class Solution {
public:
int rectCover(int number) {
if(number == 0)
return 1;
int a[10005];
a[1] = 1;
a[2] = 2;
for(int i = 3; i < 10005; i++)
a[i] = a[i - 1] + a[i - 2];
return a[number];
}
};
剑指offer 矩形覆盖
最新推荐文章于 2020-08-07 23:23:30 发布