#P1255. Staircase Problem
Staircase Problem
Staircase Problem
You are given a staircase with N steps. In each move, you can either climb one step or two steps. The total number of distinct ways to climb to the top of the staircase can be calculated using the recurrence relation:
$$ways(N)=ways(N-1)+ways(N-2)$$
with the base conditions $$ways(0)=1$$ and $$ways(1)=1$$.
Your task is to write a program that computes the number of different ways to climb a staircase with N steps.
inputFormat
The input consists of a single integer N (where 0 ≤ N ≤ 10^5), representing the number of steps in the staircase.
outputFormat
Output a single integer, the number of distinct ways to climb the staircase.
sample
0
1