[BOJ 14852] 타일 채우기 3

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 512M

Problem type
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

2×N 크기의 벽을 2×1, 1×2, 1×1 크기의 타일로 채우는 경우의 수를 구해보자.

입력 형식

첫째 줄에 N(1 ≤ N ≤ 1,000,000)이 주어진다.

출력 형식

첫째 줄에 경우의 수를 1,000,000,007로 나눈 나머지를 출력한다.

예제 입력 1

1

예제 출력 1

2

예제 입력 2

2

예제 출력 2

7

예제 입력 3

3

예제 출력 3

22

Comments

There are no comments at the moment.