백준 15990 java
-
boj)15590 - 1, 2, 3 더하기 5PS/boj 2020. 9. 17. 14:13
import java.util.*; public class boj_15990 { static final long mod = 1000000009L; static final int limit = 100000; static long[][] d = new long[limit+1][4]; public static void main(String args[]) { Scanner sc = new Scanner(System.in); for (int i=1; i= 0) { d[i][1] = d[i-1][2] + d[i-1][3]; if (i == 1) { d[i][1] = 1; } } if (i-2 >= 0) { d[i][2] = d[i-2][1] + d[i-2][3]; if (i == 2) { d[i][2] = 1; }..