알고리즘(python)/탐색
[Python]최소신장트리 백준 9372
문제 https://www.acmicpc.net/problem/9372 새로운 비행기를 무서워한다.조건이 조금 이상하지만 문제를 만들기 위해서 이렇게 한거같다. 비행기의 종류만을 따지기 때문에 각 국가를 연결하는 최소연결 수인 N-1이 정답이된다. 최소신장트리(MinimunSpanningTree,MST)https://gmlwjd9405.github.io/2018/08/28/algorithm-mst.html 12345678import sysT=int(sys.stdin.readline()) for _ in range(T): N,M=map(int,sys.stdin.readline().split()) for _ in range(M): a,b=map(int,sys.stdin.readline().split()) p..
2020. 3. 23. 23:36
최근댓글