1834 Single-Threaded CPU
class Solution:
def getOrder(self, tasks: List[List[int]]) -> List[int]:
for i, task in enumerate(tasks):
task.append(i)
tasks.sort()
ans = []
q = []
n = len(tasks)
i = t = 0
while q or i < n:
if not q:
t = max(t, tasks[i][0])
while i < n and tasks[i][0] <= t:
heappush(q, (tasks[i][1], tasks[i][2]))
i += 1
pt, j = heappop(q)
ans.append(j)
t += pt
return ans
621 Task Scheduler
630 Course Schedule III
1029 Two City Scheduling
1229 Meeting Scheduler
2365 Task Scheduler II
1335 Minimum Difficulty of a Job Schedule
1462 Course Schedule IV
207 Course Schedule
210 Course Schedule II文章来源:https://www.toymoban.com/news/detail-803605.html
815 Bus Routes文章来源地址https://www.toymoban.com/news/detail-803605.html
到了这里,关于APS排产相关的leetcode的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!