def getOrder(self, tasks: List[List[int]]) -> List[int]:
start_q = [tasks[i] + [i] for i in range(len(tasks))]
heapify(start_q)
start, time, idx = heappop(start_q)
time_q = [[time, idx, start]]
ans = []
cur = start
while len(time_q):
time, idx, start = heappop(time_q)
cur = cur + time
ans.append(idx)
while len(start_q) and start_q[0][0] <= cur:
start, time, idx = heappop(start_q)
heappush(time_q, [time, idx, start])
if len(time_q) == 0 and len(start_q):
start, time, idx = heappop(start_q)
cur = start
heappush(time_q, [time, idx, start])
댓글 영역
획득법
① NFT 발행
작성한 게시물을 NFT로 발행하면 일주일 동안 사용할 수 있습니다. (최초 1회)
② NFT 구매
다른 이용자의 NFT를 구매하면 한 달 동안 사용할 수 있습니다. (구매 시마다 갱신)
사용법
디시콘에서지갑연결시 바로 사용 가능합니다.