在将两个点连边的过程中,不要这样写:
for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ edge[i].push_back(e{j,dist(i,j)}); } }
应当这样写:
for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ edge[i].push_back(e{j,dist(i,j)}); } }
具体原因未知,是玄学