#include<queue> #include<vector> using namespace std; struct cmp //重写优先关系 从大到小 { bool operator () (const int a, const int b) const { return a%10 > b%10; } }; int main() { priority_queue<int, vector<int>,cmp> pq; //优先队列的声明 return 0; }
时间: 2024-10-08 09:48:57