优先队列
引自:洛谷P3378 【模板】堆
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200912212002602.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhdGZhaXJ5eXk=,size_16,color_FFFFFF,t_70#pic_center)
#输入
5
1 2
1 5
2
3
2
#输出
2
5
AC代码:
#include <iostream>
#include <queue>
using namespace std;
typedef long long ll;
priority_queue<ll,vector<int>,greater<int> > q;
int main()
{
ll n;
cin>>n;
while(n--){
int key;
ll num;
cin>>key;
if(key == 1){
cin>>num;
q.push(num);