Skip to content

Commit 8f0f74b

Browse files
committed
cpu
1 parent 253ed67 commit 8f0f74b

File tree

1 file changed

+2
-2
lines changed
  • 1834.single_threaded_cpu

1 file changed

+2
-2
lines changed

1834.single_threaded_cpu/cpu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ def getOrder(self, tasks: List[List[int]]) -> List[int]:
6767
while sorted_tasks or min_heap:
6868
while sorted_tasks and sorted_tasks[-1].enqueue <= cur_time:
6969
heapq.heappush(min_heap, sorted_tasks.pop())
70-
if len(min_heap) < 1:
70+
if not min_heap:
7171
cur_time = sorted_tasks[-1].enqueue
7272
else:
7373
task = heapq.heappop(min_heap)
74-
cur_time = cur_time+task.processing
74+
cur_time = cur_time + task.processing
7575
processed.append(task.index)
7676

7777
return processed

0 commit comments

Comments
 (0)