https://www.acmicpc.net/problem/16398최소 스패닝 트리 문제입니다.두 행성을 잇는 간선을 정리해 크루스칼 알고리즘으로 풀었습니다. import sysinput = sys.stdin.readline# union-finddef Union(group_list, n1, n2): # 그룹 g1 = Find(group_list, n1) g2 = Find(group_list, n2) # 두 그룹이 같으면 if g1 == g2: # 병합하지 않음 return False, group_list # 다르면 그룹이 작은쪽으로 병합 if g1 > g2: group_list[g1] = g2 else: ..