Problem BBRICKS from Codechef Long challenge

Revision en1, by Siriuslight, 2018-10-21 13:32:09

How to solve this problem using matrix exponentiation. The recurrence relation is :

f(n, k, 0) = 2 * f(n - 1, k, 1) + f(n - 1, k, 0)

f(n, k, 1) = f(n - 1, k, 1) + f(n - 1, k, 0)

1 < n < 1e9

1 < k < 1e3

Tags #matrix exponentialtion, #dp, #codechef

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Siriuslight 2018-10-21 13:32:09 280 Initial revision (published)