1.建队列
利用自带的stl模板
#include<queue>
priority_queue<int>q;
//priorioty_queue<int,vector<int>>,greater<int>q;
2.基本操作
q.pop()//弹出队顶
q.top()//返回队首
q.push(n)//推进队列
1.建队列
利用自带的stl模板
#include<queue>
priority_queue<int>q;
//priorioty_queue<int,vector<int>>,greater<int>q;
2.基本操作
q.pop()//弹出队顶
q.top()//返回队首
q.push(n)//推进队列