填色
Description
有排成一行的n个方格,用红(Red)、粉(Pink)、绿(Green)三色涂每个格子,每格涂一色,要求任何相邻的方格不能同色,且首尾两格也不同色.求全部的满足要求的涂法方案数,答案对10000007取模.
1<=n<=100000
Format
Input
一行一个正整数n
Output
一行表示答案
Sample 1
Input
2
Output
6
Limitation
1s, 32Mb for each test case.
Hint
Free Pascal Code
var a,b:longint;
begin
readln(a,b);
writeln(a+b);
end.
C Code
#include <stdio.h>
int main(void)
{
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
return 0;
}
C++ Code
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
cout << a + b << endl;
return 0;
}
Python Code
a, b = [int(i) for i in raw_input().split()]
print(a + b)
Java Code
import java.io.*;
import java.util.Scanner;
public class Main {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(a + b);
}
}
Source
Vijos Original
信息
- 难度
- 8
- 分类
- (无)
- 标签
- (无)
- 递交数
- 58
- 已通过
- 6
- 通过率
- 10%
- 上传者
相关
在下列比赛中: