Skip to content

Conversation

@ksinji
Copy link
Contributor

@ksinji ksinji commented Nov 5, 2025

🧷 문제 링크

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

🧭 풀이 시간

25분

👀 체감 난이도

✏️ 문제 설명

큐에 대기 중인 프로세스를 우선순위 순으로 실행할 때, 특정 프로세스가 몇 번째에 실행되는지 구하는 문제.

🔍 풀이 방법

우선순위가 남아있는 개수를 세어 둔 배열을 사용해, 현재 실행해야 할 최대 우선순위를 빠르게 찾는다. 큐에서 하나씩 꺼내며 최고 우선순위면 실행, 아니면 다시 큐에 넣는 방식으로 시뮬레이션

⏳ 회고

우선순위 탐색을 매번 선형으로 하면 비효율적이므로 카운팅을 활용하는 게 깔끔

@ksinji ksinji self-assigned this Nov 5, 2025
@ksinji ksinji added the success 👍 해설을 보지 않고 풀었을 때 label Nov 5, 2025
@ShinHeeEul ShinHeeEul merged commit 165734e into main Nov 5, 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