I was trying to solveCSES Shortest Routes Iusing priority_queue. However, I faced TLE even though I was storing negative of distance in it. After a bit of reading onCP-Algo's Page, they said that The main difference to the implementation with set is that in many languages, including C++...
vector<pii> edge[N];//edge数组存的是pair类型 {终点,权值} edge[x]的值为{y,w} 意味着一条起点为x终点为y权值为w的边intdist[N];//每个点到起点的距离intn,m,k;intdijkstra(intx,inty){ priority_queue<pii,vector<pii>,greater<pii> > q;//这个小根堆存的是{dist[i],i}memset(dist,0x3f...
I was trying to solveCSES Shortest Routes Iusing priority_queue. However, I faced TLE even though I was storing negative of distance in it. After a bit of reading onCP-Algo's Page, they said that The main difference to the implementation with set is that in many languages, including C++...