Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/2836
🧭 풀이 시간
90분
👀 체감 난이도
✏️ 문제 설명
주어진 영역을 어떻게 잘 병합할 것인가?
🔍 풀이 방법
순방향 사람은 고려안해도 된다. 어차피 M이다. 보트에 N명을 태울 수 있기 때문이다. 역방향 부분을 병합해서, 하나의 길이로 만들고$M + 역방향 부분 * 2$ 해야 한다.
⏳ 회고
N명을 태울 수 있어서 순방향일 때 M이라는 사실을 생각하지 못하고 어렵게 돌아갔다. 순방향의 cost가 M인 것만 알면 역방향 부분을 병합할 생각을 할 수 있다.