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