Skip to content

Commit

Permalink
Baekjoon #11726
Browse files Browse the repository at this point in the history
  • Loading branch information
allrightDJ0108 committed Jul 20, 2023
1 parent 1c57390 commit 0702066
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Binary file not shown.
22 changes: 22 additions & 0 deletions CodingTestStudy1.0/src/DynamicProgramming/Problem11726.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package DynamicProgramming;

import java.io.*;

public class Problem11726 {

static int[] d = new int[1000+1];

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

int N = Integer.parseInt(br.readLine());

d[1] = 1;
d[2] = 2;
for (int i=3; i<N+1; i++) {
d[i] = (d[i-1] + d[i-2]) % 10007;
}

System.out.println(d[N]);
}
}

0 comments on commit 0702066

Please sign in to comment.