[20250616] BOJ / G2 / 합이 0인 네 정수 / 이강현 #360
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/7453
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
4개의 수의 합이 0이 되는 경우의 수를 출력
🔍 풀이 방법
투 포인터
⏳ 회고
수가 각각 4000개이므로 단순한 방식으로는 불가능했음. 그래서 두개씩 묶어서 이분 탐색을 진행. 중복되는 값이 있을 수 있기때문에 lower bound와 upper bound를 둘 다 구현했는데 시간 초과가 났음. 그래서 투 포인터로 바꿨음. 이분탐색이 분류에 있긴 하던데 어떻게 최적화 해야하는지 모르겠음.