完全二叉树的权值
import os
import sys
import math
# 请在此输入您的代码
n = int(input())
l = input().split(' ')
tree = []
c = int(math.log((n + 1), 2))
for i in range(c):
tree.append([])
for j in range(2**i):
tree[i].append(l[0])
l.pop(0)
if len(l) != 0:
tree..
原创
2022-01-24 14:24:45 ·
199 阅读 ·
0 评论