题目与讲解思路:
代码:
import java.io.BufferedInputStream;
import java.util.Scanner;
public class MinimumSpanningTree {
public static void main(String[] args) {
Scanner cin = new Scanner(new BufferedInputStream(System.in));
int n = cin.nextInt();
int M[][] = new int[n][n];
for (int i=0;i<n;i++){
for (int j=0