Submit solution
Points:
25 (partial)
Time limit:
4.5s
Memory limit:
64M
Author:
Problem type
Allowed languages
C, C++, Java, Pascal, Python
Climbing Stairs
To climb to the top of a staircase with steps, we can take steps of one or two stairs at a time. The problem lies in finding the number of different ways we can climb to reach the top of the staircase. For example, for steps, there are different ways: , , .
Input
A file named steps.in contains an integer on the first line (where ) indicating the number of cases. Then, following are numbers, each indicating the number (where ) of steps of a staircase.
Output
A file named steps.out containing integers (one integer per line), each indicating the number of different ways to climb for each case. The output file should end with a newline character.
Example of Input - Output Files
STDIN (steps.in)
2
4
3
STDOUT (steps.out)
5
3
Maximum execution time: . seconds
Comments