From be49778265c8c160dad816167bc96eb56e8006dc Mon Sep 17 00:00:00 2001 From: suyeun84 <81475092+suyeun84@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:48:13 +0900 Subject: [PATCH] =?UTF-8?q?[20250724]=20BOJ=20/=20G5=20/=20=EC=84=9C?= =?UTF-8?q?=EB=A1=9C=20=EB=8B=A4=EB=A5=B8=20=EC=9E=90=EC=97=B0=EC=88=98?= =?UTF-8?q?=EC=9D=98=20=ED=95=A9=20/=20=EA=B9=80=EC=88=98=EC=97=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\354\210\230\354\235\230 \355\225\251.md" | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 "suyeun84/202507/24 BOJ G5 \354\204\234\353\241\234 \353\213\244\353\245\270 \354\236\220\354\227\260\354\210\230\354\235\230 \355\225\251.md" diff --git "a/suyeun84/202507/24 BOJ G5 \354\204\234\353\241\234 \353\213\244\353\245\270 \354\236\220\354\227\260\354\210\230\354\235\230 \355\225\251.md" "b/suyeun84/202507/24 BOJ G5 \354\204\234\353\241\234 \353\213\244\353\245\270 \354\236\220\354\227\260\354\210\230\354\235\230 \355\225\251.md" new file mode 100644 index 00000000..e72b1627 --- /dev/null +++ "b/suyeun84/202507/24 BOJ G5 \354\204\234\353\241\234 \353\213\244\353\245\270 \354\236\220\354\227\260\354\210\230\354\235\230 \355\225\251.md" @@ -0,0 +1,33 @@ +```java +import java.io.*; +import java.util.*; + +public class boj9764 { + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static StringTokenizer st; + static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());} + static int nextInt() {return Integer.parseInt(st.nextToken());} + + public static void main(String[] args) throws Exception { + nextLine(); + int T = nextInt(); + int[] arr = new int[T]; + int max = 0; + for (int i = 0; i < T; i++) { + nextLine(); + arr[i] = nextInt(); + max = Math.max(max, arr[i]); + } + int mod = 100999; + int[] dp = new int[max + 1]; + dp[0] = 1; + + for (int k = 1; k <= max; k++) { + for (int i = max; i >= k; i--) { + dp[i] = (dp[i] + dp[i - k]) % mod; + } + } + for (int i = 0; i < T; i++) System.out.println(dp[arr[i]]); + } +} +```