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