1 Star 0 Fork 0

Fropised / nlogn数据结构

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
562 Bytes
一键复制 编辑 原始数据 按行查看 历史
Fropised 提交于 2017-11-09 19:10 . luoguR3944338
#include<cstdio>
#include<ext/pb_ds/priority_queue.hpp>
#define pd __gnu_pbds
#define heaptag pairing_heap_tag
#define heap priority_queue
pd::heap<int,std::greater<int>,pd::heaptag> Heap;
int main() {
int n,opt,x; scanf("%d",&n);
for (int i = 1; i <= n; ++i) {
scanf("%d",&opt);
switch (opt) {
case 1:{
scanf("%d",&x);Heap.push(x);
break;
}
case 2:printf("%d\n",Heap.top());break;
case 3:Heap.pop();break;
}
}
return 0;
}
C++
1
https://gitee.com/Fropised/nlogn.git
git@gitee.com:Fropised/nlogn.git
Fropised
nlogn
nlogn数据结构
master

搜索帮助