Skip to content

Conversation

@suyeun84
Copy link
Contributor

@suyeun84 suyeun84 commented Sep 3, 2025

🧷 문제 링크

https://school.programmers.co.kr/learn/courses/30/lessons/42627

🧭 풀이 시간

30분

👀 체감 난이도

✏️ 문제 설명

우선순위 디스크 컨트롤러가 있을 때,
대기 큐가 비어있지 않으면 가장 우선순위가 높은 작업을 대기 큐에서 꺼내서 작업함
작업의 소요시간이 짧은 것, 작업의 요청 시각이 빠른 것, 작업의 번호가 작은 것 순으로 우선순위가 높음
디스크 컨트롤러가 작업을 처리했을 때 모든 요청 작업의 반환 시간의 평균의 정수부분 구하기

🔍 풀이 방법

PriorityQueue 사용
걸리는 시간, 시작 시간 순으로 정렬을 하고, pq에서 하나씩 꺼내면서 각 작업의 완료되는 시간을 더해줌
이후에 작업의 총 갯수로 나눠서 평균 구함

⏳ 회고

조금의 생각이 필요한 문제였다.

@suyeun84 suyeun84 self-assigned this Sep 3, 2025
@suyeun84 suyeun84 added the success 👍 해설을 보지 않고 풀었을 때 label Sep 3, 2025
@ShinHeeEul ShinHeeEul merged commit 9ef7ac8 into main Sep 3, 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