일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- Class
- Decorator
- Regular Expression
- Substring with Concatenation of All Words
- Generator
- Python Code
- shiba
- kaggle
- concurrency
- 프로그래머스
- 315. Count of Smaller Numbers After Self
- 컴퓨터의 구조
- LeetCode
- Convert Sorted List to Binary Search Tree
- 109. Convert Sorted List to Binary Search Tree
- iterator
- Python
- 시바견
- DWG
- 운영체제
- 파이썬
- 밴픽
- attribute
- 30. Substring with Concatenation of All Words
- t1
- 43. Multiply Strings
- data science
- Protocol
- Python Implementation
- 715. Range Module
Archives
- Today
- Total
목록1834. Single-Threaded CPU (1)
Scribbling
LeetCode: 1834. Single-Threaded CPU
class Solution: def getOrder(self, tasks: List[List[int]]) -> List[int]: import heapq ret = [] TaskHeap = [] WaitHeap = [] for idx, task in enumerate(tasks): heapq.heappush(TaskHeap, (task[0], idx, task[1])) curTime = 0 while True: if not WaitHeap: if not TaskHeap: break startTime, idx, processTime = heapq.heappop(TaskHeap) heapq.heappush(WaitHeap, (processTime, idx, startTime)) while TaskHeap a..
Computer Science/Coding Test
2022. 3. 8. 21:26