Why wasting space and time for such simple question ? :) Here's O(1) time / O(1) space solution which generates precise answer.

This is based on the fact that fibonacci numbers series grows exponentially with the golden ratio as a base.

Update: As tutubalin correctly pointed out this is actually O(log(n)) time because of pow()

```
class Solution {
public:
int climbStairs(int n) {
double sqrt5 = sqrt(5.0);
double pfi = (1.0+sqrt5)/2;
return (pow(pfi, n+1) - pow(-pfi, -(n+1)))/sqrt5 + 0.5;
}
};
```