Skip to content

Learning path · Algorithm Foundations

Back to lesson · Dynamic programming

계단 오르는 방법의 수 구하기

Unrated
한국어

Language

Contribute a translation
Time limit
1000 ms
Memory limit
256 MB
Submissions
0
Correct
0
Solved by
0
AC rate

Statement

계단은 모두 $n$칸이고, 한 번에 1칸 또는 2칸을 오를 수 있다. 0번째 칸에서 출발하여 $n$번째 칸에 도착하는 서로 다른 방법의 수를 구하시오.

Input

첫째 줄에 계단의 칸 수 $n$이 주어진다. ($1 \le n \le 20$)

Output

서로 다른 방법의 수를 한 줄에 출력한다.

Examples

Sample input 1
4
Sample output 1
5
Sample input 2
1
Sample output 2
1

Tags

No tags yet