import sys import heapq from typing import List class Solution: def miniSpanningTree(self, n: int, m: int, cost: List[List[int]]) -> int: graph = [[] for _ in range(n + 1)] # 构建邻接表描述的图 for u, v, c in cost: graph[u].append((v, c)) graph[v].append((u, c...