Skip to content

Instantly share code, notes, and snippets.

@yaboong
Created February 26, 2018 07:05
Show Gist options
  • Save yaboong/e624944318d697803cf3c22b6812545d to your computer and use it in GitHub Desktop.
Save yaboong/e624944318d697803cf3c22b6812545d to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class TwoByNTiling11726 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long d[] = new long[N+1];
d[0] = 1;
d[1] = 1;
for (int n=2; n<=N; n++){
d[n] = d[n-1] + d[n-2];
d[n] %= 10007;
}
System.out.println(d[N]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment