2015年8月27日
摘要: 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... 阅读全文
posted @ 2015-08-27 23:13 _fukua 阅读(373) 评论(0) 推荐(0)
摘要: 一棵树,边长都是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... 阅读全文
posted @ 2015-08-27 19:47 _fukua 阅读(310) 评论(0) 推荐(0)