链接、
红书模板
明明s == t的时候k要++,为什么红书一点都没提啊啊啊啊啊啊啊啊啊啊啊啊啊啊、
#include<cstdio>
#include<queue>
#include<string.h>
#include<utility>
using namespace std;
typedef long long ll;
//#define getchar()(p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)
//char buf[(1 << 21) + 1], *p1 = buf, *p2 = buf;
const int maxn = 1e4+7,maxm = 1e6+7;
int n,m,cnt;
int head[2][maxn],to[2][maxm],nex[2][maxm],val[2][maxm],dist[maxn];
bool vis[maxn];
void add(int u,int v,int w){
to[0][cnt] = v;
to[1][cnt] = u;
val[0][cnt] = val[1][cnt] = w;
nex[0][cnt] = head[0][u];
nex[1][cnt] = head[1][v];
head[0][u] = head[1][v] = cnt++;
}
priority_queue<pair&