Dijkstra模板
import java.util.*;
public class dijikstra_e {
static int maxn=100000+5;
static int maxm=maxn+5;
static class E{
//链式前向星存图
int to,w,next;
E(int to,int w,int next){
this.to=to;
this.w=w;
this.next=next;
}
}
static class node{
//优先队列结点
int key,value;
node(int value,int key){
this.value=value;
this.key=key;
}
}
//定义优先队列,优先弹出路径最短的结点
static PriorityQueue<node> q=new PriorityQueue<node>(new Comparator<node>(){
public int compare(node a,node b){
return a.value-b.value;
}
});
static E edge[]=new E[maxm]; //边数
static int head[]=new int[maxn];
static int d[] =new int [maxn];//到起点的最短路
static int vis[]=new int [maxn];
static int n,m;
static void AddEdge(int u,int v,