题目链接(测试数据弱化版):https://www.luogu.com.cn/problem/P3371
题目链接(测试数据强化版):https://www.luogu.com.cn/problem/P4779
import java.io.*;
import java.util.*;
class Edge implements Comparable<Edge> {
int to, w;
Edge() {
to = w = 0; }
Edge(int m_to, int m_w) {
to = m_to;
w = m_w;
}
public int compareTo(Edge obj) {
return this.w - obj.w;
}
}
class Main {
static int INF = 0x7fffffff;
static int[] dis;
static boolean[] vis;
static ArrayList<Edge>[] G;
@SuppressWarnings("unchecked"