Created
April 27, 2017 13:04
-
-
Save developer-sdk/82e28006f53fbf9ff4f166609498f9b4 to your computer and use it in GitHub Desktop.
정올, 다이나믹, 1411, 두 줄로 타일 깔기
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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