From 7d133583bb0af6c6ebd2f5b2de92df5bd668afe3 Mon Sep 17 00:00:00 2001 From: longrunpc Date: Fri, 5 Dec 2025 23:03:42 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Solve(dp):=20BOJ=202073=20"=EC=88=98?= =?UTF-8?q?=EB=8F=84=EB=B0=B0=EA=B4=80=EA=B3=B5=EC=82=AC"=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- boj/solved/dp/2073/Main.java | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 boj/solved/dp/2073/Main.java diff --git a/boj/solved/dp/2073/Main.java b/boj/solved/dp/2073/Main.java new file mode 100644 index 0000000..3c43b1e --- /dev/null +++ b/boj/solved/dp/2073/Main.java @@ -0,0 +1,34 @@ +import java.io.*; +import java.util.*; + +class Main { + static int D, P; + static int[][] pipes; + static int[] dp; + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + StringTokenizer st = new StringTokenizer(br.readLine()); + D = Integer.parseInt(st.nextToken()); + P = Integer.parseInt(st.nextToken()); + pipes = new int[P][2]; + dp = new int[D+1]; // idx 거리르 구하는 최대 수도관 용량 + + for(int i = 0;i a[0])); + dp[0] = 100001; + for(int[] pipe : pipes) { + int d = pipe[0]; + int p = pipe[1]; + + for(int i = D;i>= d;i--){ // 더해서 i가 될때 + dp[i] = Math.max(dp[i], Math.min(p, dp[i-d])); + } + } + System.out.println(dp[D]); + } +} \ No newline at end of file From c6a7130e77a2509878de9bb2f3f51122517f1f96 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Dec 2025 15:46:27 +0000 Subject: [PATCH 2/2] Initial plan