填色
Description
有排成一行的n个方格,用红(Red)、粉(Pink)、绿(Green)三色涂每个格子,每格涂一色,要求任何相邻的方格不能同色,且首尾两格也不同色.求全部的满足要求的涂法方案数,答案对10000007取模.
1<=n<=100000
Format
Input
一行一个正整数n
Output
一行表示答案
Sample 1
Input
Output
Limitation
1s, 32Mb for each test case.
Hint
Free Pascal Code
C Code
C++ Code
Python Code
Java Code
Source
Vijos Original
信息
- 难度
- 8
- 分类
- (无)
- 标签
- (无)
- 递交数
- 58
- 已通过
- 6
- 通过率
- 10%
- 上传者
相关
在下列比赛中: