[20250928] BOJ / G4 / 좋다 / 이강현 #993
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/1253
🧭 풀이 시간
20분
👀 체감 난이도
✏️ 문제 설명
배열의 두 개의 서로 다른 수의 합으로 만들 수 있는 수는 좋은 수임.
좋은 수의 개수 구하자.
🔍 풀이 방법
투 포인터
정렬 후 왼쪽 끝과 오른쪽 끝에 포인터를 두고 그 합이 작다면 왼쪽이 이동 반대면 오른쪽 이동
포인터 위치가 같아지면 종료
이때 포인터 위치가 현재 만들려고 하는 값의 위치랑 같다면 continue
⏳ 회고
ez