#include<bits/stdc++.h> using namespace std; typedef long long LL; struct node { LL d;//Storage distance int u;//The label of the point bool operator < ( const node& b) const// & means a reference, { return d > bd; // When defining a priority queue, the > here represents the order of entering a finite queue, // That is, big first, so the order is small first } }; // < is an overloaded operator, that is, if there are two structures a, b must be a<b when comparing if the result is true, it means ad > bd; if it is false, it means ad < bd
Structure & Priority Queue Custom Sorting
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325937366&siteId=291194637
Ranking