dijkstra堆优化板子
咕咕咕 、 #include<queue> #include<cstdio> #include<cstring> #include<algorithm> #define mk make_pair #define ll long long using namespace std; inline ll read()//快读 { ll sum = 0,p = 1; char ch = getchar(); while(ch < '0' || ch > '9') { if(ch == '-') p = -1; ch = getchar(); } while(ch >= '0' && ch <= '9') { (sum *= 10) += ch - '0'; ch = getchar(); } return sum * p; } const int N=100005; const int M=2e5+5; int n,m,s; int cnt,head[N]; ll dis[N]; bool vis[N]; struct edge { int nxt,to; ll wei; }e[M]; priority_queue< pair<ll,int> > q; void add(int x,int y,ll z) { e[++cnt].nxt=head[x]; e[cnt].to=y; e[cnt