可以推导出,每层的点数是1+2+...+n,也就是(1+n)*n//2 然后总点数是该层前缀和,化简得到n*(n+1)*(n+2)//6 class Solution: def getNums(self , n: int) -> int: # write code here &n...