题解 | 【模板】整数优先队列
【模板】整数优先队列
https://www.nowcoder.com/practice/a88e9711f7b04369982bbe8902278ae4
import heapq
n=int(input())
heap=[]
for i in range(n):
s=list(map(int,input().split()))
if int(s[0])==1:
heapq.heappush(heap,s[1])
elif s[0]==2:
print(heap[0])
elif s[0]==3:
heapq.heappop(heap)
查看16道真题和解析