树上距离为k的路径的数量
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
给你一个n个点的树,求树上距离为k的路径的数量
输入格式
第1行两个数n和k分别代表节点个数与距离
第2行到n行,每行两个数x和y表示一条边
输出格式
一个整数ans,表示路径长度为k的数量,注意a-b与b-a算一中情况
5 2
1 2
2 3
3 4
2 5
4
5 3
1 2
2 3
3 4
4 5
2
数据规模与约定
对于 的数据,。