3
bool operator()(pair<int, int> &a, pair<int, int> &b) {4
return a.second > b.second;10
int networkDelayTime(vector<vector<int>> ×, int n, int k) {11
vector<pair<int, int>> a[n];12
for (auto it : times) {13
a[it[0] - 1].push_back({it[1] - 1, it[2]});16
priority_queue<pair<int, int>, vector<pair<int, int>>, cmp> pq;17
vector<int> dist(n, 1e7);21
vector<int> vis(n, 0);33
for (auto it : a[v]) {34
if (vis[it.first] == 0) {35
pq.push({it.first, it.second + w});41
for (auto it : dist) mx = max(mx, it);43
if (mx >= 1e7) return -1;