優先隊列的結構體排序使用方法(經過重載的方法,排序結果與普通數組排序sort正好相反)

#include <bits/stdc++.h> using namespace std; struct node { int a,b; bool operator < (const node &th) const{ if(a != th.a) return a < th.a; return b > th.b; } }; int main(){ int n; while(cin
相關文章
相關標籤/搜索