From 1e71ff846f847df9b100e6c26fdb38a53e0e3964 Mon Sep 17 00:00:00 2001 From: Jonghwan Lee <123362165+0224LJH@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:57:44 +0900 Subject: [PATCH] =?UTF-8?q?[20251203]=20BOJ=20/=20G5=20/=20=ED=95=A9?= =?UTF-8?q?=EB=B6=84=ED=95=B4=20/=20=EC=9D=B4=EC=A2=85=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...J \355\225\251\353\266\204\355\225\264.md" | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 "0224LJH/202512/03 BOJ \355\225\251\353\266\204\355\225\264.md" diff --git "a/0224LJH/202512/03 BOJ \355\225\251\353\266\204\355\225\264.md" "b/0224LJH/202512/03 BOJ \355\225\251\353\266\204\355\225\264.md" new file mode 100644 index 00000000..a45d2449 --- /dev/null +++ "b/0224LJH/202512/03 BOJ \355\225\251\353\266\204\355\225\264.md" @@ -0,0 +1,53 @@ +```java + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.StringTokenizer; + +public class Main { + + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static int target, cnt; + static long[][] dp; + + public static void main(String[] args) throws IOException { + init(); + process(); + print(); + + } + + private static void init() throws IOException{ + StringTokenizer st = new StringTokenizer(br.readLine()); + target = Integer.parseInt(st.nextToken()); + cnt = Integer.parseInt(st.nextToken()); + dp = new long[target+1][cnt+1]; + } + + private static void process() throws IOException { + dp[0][0] = 1; + for (int i = 0; i <= target; i++) { + for (int j = 0; j <= target; j++) { + if (i+j > target) break; + for (int k = 1; k <= cnt; k++) { + dp[i+j][k] += dp[i][k-1]; + dp[i+j][k] %= 1000_000_000; + } + } + } + + + } + + + private static void print() { + System.out.println(dp[target][cnt]); + } + +} +```