版本比较
+1 −1增加 1 行删除 1 行
140 行未改动全部展开141142143144145145146147148149118 行未改动全部展开140 行未改动全部展开 node x=q.top(); q.pop(); int u=x.now; //记录堆顶(堆内最小的边)并将其弹出 if(vis[u]) continue; if(vis[u]) continue; //没有遍历过才需要遍历 vis[u]=1; for(int i=head[u];i;i=e[i].next) //搜索堆顶所有连边118 行未改动全部展开