Solution 对于原树一个节点\(x\): \(f_x(h)\)表示,\(x\)作为一个深度为\(h\)的点时,\(x\)及其子树的安排方案有多少(不考虑\(x\)具体在深度为\(h\)的哪个点) \(F_x(h)\)表示,对于一个固定的深度为\(h\)的节点\(y\),\(x\)在\(y\)或其子树中,\(x\)及其子树的安排方案有多少. 则有关系: \[ F_x(h)=\sum_{i\ge h}f_x(i)*2^{i-h} \] 对于叶子: \[ F_x(h)=[h\le h_x]2^{…