wyuan; moneyDP.cpp; AC - DP is very fast.
wyuan; nocows; Dp - Let B(n, d) be the number of possible pedigrees binary tree, whose nodes are n and depth are <= d. B(n, d) = B(n1, d-1) * B(n-1-n1, d-1). Pay attention to boundary conditions.