Submission #227977


Source Code Expand

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import static java.lang.Integer.parseInt;

public class B {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";

		long[] a = new long[1000001];
		a[3] = 1;
		for (int i = 4; i < 1000001; i++) {
			a[i] = a[i - 1] + a[i - 2] + a[i - 3];
		}
		System.out.println(a[parseInt(br.readLine())] % 10007);
	}

}

Submission Info

Submission Time
Task B - トリボナッチ数列
User sawfish
Language Java (OpenJDK 1.7.0)
Score 0
Code Size 524 Byte
Status CE

Compile Error

./Main.java:7: error: class B is public, should be declared in a file named B.java
public class B {
       ^
1 error