help in coloring problem.

Правка en1, от bhayanak, 2017-09-04 12:29:41

How to solve this simple problem?

You are given a tree of N vertices, and an integer K. How many ways are there to colour the tree with K colours such that no edge is adjacent to vertices of the same colour.

Since the answer may be large, output the answer modulo 1,000,000,007.

Please explain how did u arrive at the result?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский bhayanak 2017-09-04 12:29:41 359 Initial revision (published)