We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d87bae commit 35c560bCopy full SHA for 35c560b
1 file changed
ksinji/202601/26 BOJ 합분해.md
@@ -0,0 +1,35 @@
1
+```java
2
+import java.io.*;
3
+import java.util.*;
4
+
5
+public class Main {
6
+ static int n, k;
7
+ static int[][] dp;
8
9
+ public static void main(String[] args) throws Exception {
10
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
11
+ StringTokenizer st = new StringTokenizer(br.readLine());
12
13
+ n = Integer.parseInt(st.nextToken());
14
+ k = Integer.parseInt(st.nextToken());
15
16
+ dp = new int[k + 1][n + 1];
17
18
+ for (int i = 0; i <= n; i++) {
19
+ dp[1][i] = 1;
20
+ }
21
22
+ for (int i = 2; i <= k; i++) {
23
+ for (int j = 0; j <= n; j++) {
24
+ if (j == 0) {
25
+ dp[i][j] = 1;
26
+ } else {
27
+ dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % 1000000000;
28
29
30
31
32
+ System.out.println(dp[k][n]);
33
34
+}
35
+```
0 commit comments