Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
📘 풀이한 문제
⭐ 문제에서 주로 사용한 알고리즘
📜 대략적인 코드 설명
빈 그래프에 무거운 간선부터 생성해나아가면서 parent가 달랐다면 이어지기전에 계산해 구합니다. 이어지기 전에 계산해 구한합은 즉 , A집합* B집합 *(모든가중치간선합 - 현재 이어진 가중치간선합)
말로설명하는게 굉장히 어려워서 타블로그에서 정리되어있는 그림을 퍼왔습니다
p.s. 합치는 배열은 Long타입이어야합니당..