import heapq n = int(input()) nums_input = [(int(num), 0) for num in input().split()] # 每个元素为(num, 0),0表示huffman树的叶子节点 # 构造堆 nums = [] for num in nums_input: heapq.heappush(nums, num) # 构造huffman树,其为字典类型, # (key, value) = ((num, 1), (child_l, child_r, 0)) # (num, 1)中1表示huffman树的非叶子节点 # (child...