Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boj 6497 전력난 #959

Merged
merged 1 commit into from
Oct 20, 2023
Merged

boj 6497 전력난 #959

merged 1 commit into from
Oct 20, 2023

Conversation

emost22
Copy link
Owner

@emost22 emost22 commented Oct 20, 2023

알고리즘 분류

mst, kruskal, disjoint set

풀이 방법

  1. 입력된 u, v, w를 구조체 배열에 넣는다.
  2. 구조체 배열을 w 기준 오름차순으로 정렬한다.
  3. union-find로 w가 작은 간선부터 연결한다.
  4. cnt == N - 1이면 반복문을 탈출해서 sum - ret을 출력한다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant