Problem Description
Loading...
Problem Analysis
To reach stair n there are only two cases: from stair n-2 or from stair n-1
So we have
a[i]=a[i-1]+a[i-2]
the Fibonacci sequence
cpp
| |
Problem link: [HDU] [2041] Super Stairs
To reach stair n there are only two cases: from stair n-2 or from stair n-1
So we have
a[i]=a[i-1]+a[i-2]
the Fibonacci sequence
| |
Problem link: [HDU] [2041] Super Stairs
Loading...