小顶堆,如果大顶堆,取相反数放进去就行!
from heapq import heappush,heappop
n = int(input())
nums = []
# 插入数值
heappush(nums , 1)
# 删除数值
heappop(nums)
print(len(max_Rs))
# 已有数组转换
nums2 = [1,3,2]
heapify(nums2)
小顶堆,如果大顶堆,取相反数放进去就行!
from heapq import heappush,heappop
n = int(input())
nums = []
# 插入数值
heappush(nums , 1)
# 删除数值
heappop(nums)
print(len(max_Rs))
# 已有数组转换
nums2 = [1,3,2]
heapify(nums2)