#include struct edge { int u,v; int w; }; const int N=100; std::priority_queue> pq; std::vector e; std::vector > h; std::vectordis; std::vectorvis; void rebuild(int &n) { e.clear(); h.resize(n+1); h.assign(n+1,std::vector()); dis.resize(n+1); dis.assign(n+1,FLT_MAX); vis.resize(n+1); vis.assign(n+1,0); } void add(int u,int v,int w) { e.push_back({u,v,w}); h[u].push_back(e.size()-1); } void dij(int s) { int x; dis[s]=0; pq.push({0,s}); while(pq.size()) { auto p=pq.top();pq.pop(); x=p.second; //cout<<"x="<