优先队列
View Code
//头文件:#include <queue> struct Tpoint{ int val,dead; //Tpoint(int v,int d):val(v),dead(d) {} bool friend operator<(Tpoint x,Tpoint y) { if(x.val!=y.val) return x.val>y.val; else return x.dead>y.dead; } }; //多个key,重载运算符,que.top()保存的是val最小的 priority_queue<Tpoint>que;