diff --git "a/LiiNi-coder/202509/08 BOJ \353\217\231\354\240\204 1.md" "b/LiiNi-coder/202509/08 BOJ \353\217\231\354\240\204 1.md" new file mode 100644 index 00000000..70af64c2 --- /dev/null +++ "b/LiiNi-coder/202509/08 BOJ \353\217\231\354\240\204 1.md" @@ -0,0 +1,35 @@ +```java +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Arrays; +import java.util.StringTokenizer; + +public class Main { + private static BufferedReader br; + + public static void main(String[] args) throws IOException { + br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st = new StringTokenizer(br.readLine()); + int n = Integer.parseInt(st.nextToken()); + int k = Integer.parseInt(st.nextToken()); + int[] coins = new int[n]; + for (int i = 0; i < n; i++) { + coins[i] = Integer.parseInt(br.readLine()); + } + int[] dp = new int[k + 1]; + Arrays.fill(dp, 0); + + dp[0] = 1; + + for (int coin : coins) { + if (coin > k) continue; + for (int j = coin; j <= k; j++) { + dp[j] += dp[j - coin]; + } + } + + System.out.println(dp[k]); + } +} +```