Skip to content

Conversation

@zinnnn37
Copy link
Contributor

@zinnnn37 zinnnn37 commented Sep 10, 2025

🧷 문제 링크

중앙값 구하기

🧭 풀이 시간

60분

👀 체감 난이도

✏️ 문제 설명

최소힙, 최대힙 두 개 사용해야함

🔍 풀이 방법

홀수는 최대힙, 짝수는 최소힙에 넣음
최대힙에는 작은 수 + 중앙값, 최소힙은 큰 수

만약 홀수일 때 maxq.peek()minq.peek()보다 크면 바꿔줍니다(최대힙에 작은 수가 들어가야하니까)

이러고 홀수 확인할 때 maxq.peek() 출력해주면 됨.
10개 단위로 줄바꿈 해야함

출력되는 중앙값 개수는 숫자 / 2 + 1

⏳ 회고

충돌나서 리베이스햇더니 커밋꼬라지 난리낫네요 심란하다
내일 바꿔놓을게요...

zinnnn37 and others added 30 commits September 10, 2025 23:35
JHLEE325 and others added 26 commits September 10, 2025 23:46
@ShinHeeEul ShinHeeEul merged commit ecacf46 into main Sep 10, 2025
1 check passed
@zinnnn37 zinnnn37 added success 👍 해설을 보지 않고 풀었을 때 hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때 labels Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때 success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants