[20250909] BOJ / G3 / 파일 합치기 / 한종욱 #851
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/11066
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
파일을 합치는데 cost가 듬. 파일을 저장할 때 누적으로 저장하기 때문에, 어떤걸 먼저 더하냐에 따라 값이 달라짐
🔍 풀이 방법
dp[i][j]=i번째부터 j번째 파일을 하나로 합치는데 필요한 최소 비용따라서 dp[i][j]는
min(dp[i][j], dp[i][k] + dp[k+1][j] + (sum[j] - sum[i-1])이다.⏳ 회고
누적 합은 생각을 못했네