Skip to content

Instantly share code, notes, and snippets.

@developer-sdk
Created April 27, 2017 13:04
Show Gist options
  • Select an option

  • Save developer-sdk/82e28006f53fbf9ff4f166609498f9b4 to your computer and use it in GitHub Desktop.

Select an option

Save developer-sdk/82e28006f53fbf9ff4f166609498f9b4 to your computer and use it in GitHub Desktop.
정올, 다이나믹, 1411, 두 줄로 타일 깔기
import java.util.Scanner;
/**
* 정올, 1411, 다이나믹
* 두 줄로 타일 깔기
*
* @author whitebeard-k
*
*/
public class Problem1411 {
public static int[] memo = new int[1000001];
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.close();
memo[1] = 1;
memo[2] = 3;
for(int i = 3; i <= n; i++) {
memo[i] = ((memo[i-1]) + (2*memo[i-2]))%20100529;
}
System.out.println(memo[n]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment