版本比较
模板
正文
增加 22 行删除 0 行
30 行未改动313233343536373839404142434445464748495051525354555630 行未改动 return b; }};```---AI Dijiskra```cpp auto dij=[&](int s){ vector<ll> d(n+1,-1); priority_queue<pair<ll,int>,vector<pair<ll,int>>,greater<pair<ll,int>>> q; d[s]=0; q.push({0,s}); while(!q.empty()){ auto [t,x]=q.top(); q.pop(); if(t>d[x])continue; for(auto [y,w]:g[x]){ if(d[y]==-1||d[y]>d[x]+w){ d[y]=d[x]+w; q.push({d[y],y}); } } } return d; };```