Блог пользователя Varun12

Автор Varun12, история, 2 года назад, По-английски

Given a tree with tree nodes vertices where each vertex denotes a place in a land, find the number of ways such that exactly k vertices have an active connection. A vertex has an active connection when there is a tower in that vertex, or there is a tower in any other vertex directly connected to that vertex. Determine the total number of ways such that exactly k places have an active connection in HackerLand for each k=0,1,2,.,tree nodes. Since the answer can be large, return it modulo (10^9+7).

  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится