[20250810] BOJ / G4 / 세수의 합 / 이강현 #643
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/2295
🧭 풀이 시간
180분
👀 체감 난이도
✏️ 문제 설명
배열이 주어짐.
세 수의 합이 배열 안에 있을때, 가장 큰 합을 출력.
🔍 풀이 방법
hashset, 반복문 풀기?
원래 4개의 수를 찾아야하니까 N^4인데
식을 a+b = c -d로 변형해서
a+b를 O(N^2)으로 저장해두고 c-d를 O(N^2)으로 찾으면 된다.
⏳ 회고
이분 탐색으로 어거지로 풀라다가 실패.
혁준아 반례 찾았음
7
20
30
50
70
80
90
100
초반에 70으로 잡고 시작하고 100부터 시작하니까 이거보다 무조건 작아서 범위 확장하는데,
20 30 50이 100이라서 거기를 고려 안하더라고