Skip to content

Conversation

@suyeun84
Copy link
Contributor

🧷 문제 링크

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

🧭 풀이 시간

20분

👀 체감 난이도

✏️ 문제 설명

가희가 1초부터 T초일 때까지, 스케쥴러가 선택한 프로세스의 ID 구하기

  • 선택되지 않았으면 프로세스의 우선순위 1 상승
  • 선택됐으면 실행을 마치는 데 필요한 시간 1 감소

🔍 풀이 방법

우선순위 큐 써서 우선순위가 높은 순, id가 작은 순으로 정렬해줌

  • 선택된 프로세스 제외의 모든 프로세스의 우선순위를 1 높이는 대신
    선택된 프로세스의 우선순위를 1 낮췄다.

⏳ 회고

처음에는 System.out.println을 써서 정답을 출력했는데, 시간 초과가 떠서 BufferedWriter를 이용했다.
귀찮아서 안썼는데 앞으로는 좀 써야겠다..

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