Independent Set
Time limit2sMemory limit512 MB
Count vectors of n nonnegative integers summing to m where positions flagged by a and parent-child pairs in the implicit binary heap cannot both be positive, modulo 1e9+7.
- Level
Hard8 of 10
- Topics
- Dynamic programming, Tree, Combinatorics, Math
- Solved
- No attempts yet
Problem
Bobo has a binary sequence . He wants to count the number of sequences satisfying the following conditions modulo .
- , ;
- For all , ;
- For all , .
Input
The first line contains integers ().
The second line contains integers ().
Output
A single number denotes the number of sequence.