摘要:
New Year is coming in Tree World! In this world, as the name implies, there arencities connected byn - 1roads, and for any two distinct cities there a... 阅读全文
摘要:
一棵树,边长都是1,问这棵树有多少点对的距离刚好为k令tree(i)表示以i为根的子树dp[i][j][1]:在tree(i)中,经过节点i,长度为j,其中一个端点为i的路径的个数dp[i][j][0]:在tree(i)中,经过节点i,长度为j,端点不在i的路径的个数则目标:∑(dp[i][k][0... 阅读全文