[20250915] BOJ / G5 / 조 짜기 / 이준희 #895
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/2229
🧭 풀이 시간
40분
👀 체감 난이도
✏️ 문제 설명
각 사람들의 능력치(정수) 가 나이 순서대로 주어지고
팀은 나이 순서대로 짜야합니다.(인덱스가 연속되어야함)
각 팀의 잘 짜여진 정도는 그 팀의 능력치 최대값 - 능력치 최솟값일 때
팀 편성을 완료 했을 때 팀의 잘 짜여진 정도가 가장 높은 경우를 구하는 문제입니다.
🔍 풀이 방법
dp를 이용해서 풀었습니다.
각 인덱스 i 마다 i 부터 0까지 순회하며 최댓값을 갱신하는 방식으로 풀었습니다.
⏳ 회고
처음 문제를 봤을 때 dp 인 것 같기는 했는데 어떻게 dp 인지 쉽게 생각이 안났습니다.