Skip to content

Solve(dp): BOJ 2073 "수도배관공사" 문제 풀이#13

Merged
longrunpc merged 2 commits into
solvedfrom
copilot/sub-pr-12
Dec 8, 2025
Merged

Solve(dp): BOJ 2073 "수도배관공사" 문제 풀이#13
longrunpc merged 2 commits into
solvedfrom
copilot/sub-pr-12

Conversation

Copilot AI commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

BOJ 2073 "수도배관공사" - 배낭 DP로 거리 D를 채우면서 최소 용량(병목)을 최대화하는 문제 풀이.

풀이 접근

  • 0-1 배낭 문제 변형: dp[i] = 거리 i까지 도달할 때 가능한 최대 최소 용량
  • 역순 순회로 각 배관을 한 번만 사용하도록 보장
  • 점화식: dp[i] = max(dp[i], min(capacity, dp[i-length]))

복잡도

  • 시간: O(D×P)
  • 공간: O(D)

대안 풀이

  • 이분 탐색 + 배낭 DP: 용량을 이분 탐색하며 해당 용량 이상 파이프로 거리 D 도달 가능 여부 확인
  • Top-Down 메모이제이션: 재귀 기반 구현

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Solve dp problem BOJ 2073 Solve(dp): BOJ 2073 "수도배관공사" 문제 풀이 Dec 5, 2025
Copilot AI requested a review from longrunpc December 5, 2025 15:49
Base automatically changed from boj/2073 to solved December 8, 2025 02:38
@longrunpc
longrunpc marked this pull request as ready for review December 8, 2025 02:39
@longrunpc
longrunpc merged commit e064b7c into solved Dec 8, 2025
1 check passed
@longrunpc
longrunpc deleted the copilot/sub-pr-12 branch December 8, 2025 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants