[第1章 1.5e1] 堆-模板
35 字
1 分钟
[第1章 1.5e1] 堆-模板
#include <bits/stdc++.h>#define endl '\n'using namespace std;typedef long long ll;int main(){ ll n; cin>>n; priority_queue<ll,vector<ll>,greater<>>pq; while(n--){ ll op; cin>>op; if(op==1){ ll x; cin>>x; pq.push(x); }else if(op==2)cout<<pq.top()<<endl; else pq.pop(); } return 0;}支持与分享
如果这篇文章对你有帮助,欢迎分享给更多人或打赏支持!




