https://www.acmicpc.net/problem/2350최소 스패닝 트리 문제입니다.일반적인 최소 스패닝 트리가 아닌 최대 스패닝 트리를 만들어 타겟 노드 사이를 연결하는 노드 중 코스트가 최소인 엣지를 탐색해주면 됩니다.import sysfrom collections import dequeinput = 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 # 다르면 그룹..