일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Python Implementation
- Convert Sorted List to Binary Search Tree
- LeetCode
- 컴퓨터의 구조
- kaggle
- t1
- Generator
- 715. Range Module
- 30. Substring with Concatenation of All Words
- 시바견
- 109. Convert Sorted List to Binary Search Tree
- Python Code
- 밴픽
- concurrency
- 프로그래머스
- shiba
- attribute
- Python
- Substring with Concatenation of All Words
- iterator
- 43. Multiply Strings
- 파이썬
- DWG
- Class
- data science
- Regular Expression
- Decorator
- 315. Count of Smaller Numbers After Self
- 운영체제
- Protocol
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