Skip to content

Conversation

@JHLEE325
Copy link
Contributor

🧷 문제 링크

https://www.acmicpc.net/problem/7662

🧭 풀이 시간

30분

👀 체감 난이도

✏️ 문제 설명

우선순위가 가장 높거나 가장 낮은 수에 대해 연산할 수 있는 이중 우선순위 큐가 존재할 때
입력 또는 삭제 연산을 모두 거친 후 큐에 있는 최대값과 최소값을 구하는 문제입니다.

🔍 풀이 방법

트리맵을 사용해서 풀었습니다.
키가 숫자이고 밸류가 그 숫자의 갯수로 해서 자료구조를 유지했습니다.
트리맵은 키 기준 오름차순 정렬 되어 있기 때문에 마지막에 첫번째값, 마지막값을 출력하면 됐습니다.

⏳ 회고

트리맵을 오랜만에 사용해봤습니다.

@JHLEE325 JHLEE325 added the success 👍 해설을 보지 않고 풀었을 때 label Nov 30, 2025
@ShinHeeEul ShinHeeEul merged commit 8df5416 into main Nov 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants