일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Convert Sorted List to Binary Search Tree
- 컴퓨터의 구조
- Decorator
- Protocol
- t1
- DWG
- Python Implementation
- 30. Substring with Concatenation of All Words
- Generator
- data science
- iterator
- 운영체제
- Python Code
- Regular Expression
- kaggle
- 715. Range Module
- 315. Count of Smaller Numbers After Self
- concurrency
- 109. Convert Sorted List to Binary Search Tree
- 43. Multiply Strings
- attribute
- LeetCode
- 시바견
- 파이썬
- shiba
- 프로그래머스
- Class
- 밴픽
- Substring with Concatenation of All Words
- Python
Archives
- Today
- Total
목록network delay time (1)
Scribbling
LeetCode: 743. Network Delay Time
다익스트라 알고리즘을 활용하여 푼다. import heapq class Solution: def networkDelayTime(self, times: List[List[int]], n: int, k: int) -> int: INF = int(1e9) graph = [[] for _ in range(n+1)] distance = [INF] * (n+1) for time in times: u = time[0] v = time[1] w = time[2] graph[u].append((w, v)) self.dijkstra(graph, distance, k) max_dist = 0 for i in range(1, n+1): max_dist = max(max_dist, distance[i]) if max_dist ..
Computer Science/Coding Test
2021. 8. 10. 18:10