Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제 정보
풀이 방법
간단히 어떤 방식으로 풀었는지 설명해주세요.
프로세스들을 우선순위 큐에 넣되, aging을 일일히 구현하면 시간 초과가 발생한다.
우선순위를$P$ , 실행 요청 시각을 $R$ 이라고 할 때, 특정 시각 $T$ 에서 $i$ 번째 프로세스의 우선순위는 $P_i+(T-R_i)$ 이다. $T$ 는 모든 프로세스에게 동일하게 더해지므로, 우선순위 큐의 상대적 순서는 $P$ 와 $R$ 만 고려해도 무방하다. 즉, 우선순위 큐에 프로세스를 삽입할 때, $P_i$ 가 아니라 aging을 고려한 우선순위인 $P_i-R_i$ 을 넣게 되면, aging을 위해 매번
pop및push연산을 수행하지 않아도 된다.체크리스트
{닉네임}.{확장자})추가 코멘트
(선택사항) 추가로 공유하고 싶은 내용이 있다면 작성해주세요.