Control Point
Time limit5sMemory limit512 MB
Count the subsets of tree vertices where every special vertex has a chosen control point within r edges, modulo 1e9+7.
- Level
Hard8 of 10
- Topics
- Dynamic programming, Tree, Combinatorics
- Solved
- No attempts yet
Statement
Bobo has a tree with vertices. There are vertices on the tree that Bobo considers special.
Bobo wants to choose a subset of vertices (possibly empty) as control points, so that every special vertex can reach a control point using no more than edges.
Count the number of such subsets, modulo .