题解 | 【模板】整数优先队列
【模板】整数优先队列
https://www.nowcoder.com/practice/a88e9711f7b04369982bbe8902278ae4
from sys import stdin
from collections import *
from heapq import *
from random import *
input = lambda: stdin.readline().strip()
# read1 = stdin.read().split()
# idx = 1
h = []
for _ in range(int(input())):
x = input().split()
if x[0] == "1":
heappush(h,int(x[1]))
elif x[0] == "2":
print(h[0])
else:
heappop(h)

