[20250613] BOJ / P3 / 쓰레기 슈트 / 권혁준 #348
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/4225
🧭 풀이 시간
100분
👀 체감 난이도
✏️ 문제 설명
N각형으로 이루어진 쓰레기를 적절히 돌렸을 때, 이 쓰레기가 통과할 수 있는 최소 너비를 구해보자.

🔍 풀이 방법
[사용한 알고리즘]
주어진 N각형을 볼록 껍질로 대체해서 생각해도 된다.
일단 볼록 껍질을 만들어 두고, 볼록 껍질의 각 변을 확장한 직선과 가장 거리가 먼 점을 구한다.
각 변마다 나온 거리 중 최솟값을 구하면 정답이 된다.
⏳ 회고
풀이 자체는 금방 떠올랐는데, 점과 직선 사이의 거리를 구하는 공식을 까먹어서 인터넷에 검색해봄..
다시 코드 짜고 제출했는데 실수 오차 때문에 틀림..
실수 오차를 피하기 위해서 올림(ceil)을 할 때 epsilon(0에 한없이 가까운 양수)으로 보정해서 풀 수 있었다..