[20250916] BOJ / G4 / 사다리 / 이준희 #901
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/2022
🧭 풀이 시간
50분
👀 체감 난이도
✏️ 문제 설명
d 만큼 떨어진 두 빌딩이 있고 길이가 x, y인 사다리가 각각 두 빌딩 사이에 기대어져 X 자로 교차 되어 있습니다.
그리고 교차점의 높이가 10 일 때, d를 구하는 문제입니다.
🔍 풀이 방법
각 사다리들이 그리는 그래프의 방정식을 구했습니다.
적절한 d를 대입하여 c를 구할 수 있는 수식을 세운 후
이분탐색으로 d를 대입해가며 c가 나오는 d를 구해서 풀었습니다.
⏳ 회고
그래프가 직선이어서 수식 자체는 구하는게 어렵지 않았는데, 어떤식으로 d를 대입하며 찾아야 할지 고민을 많이 했습니다.