A question on matrix exponentiation

Правка en1, от innoshark, 2020-03-13 23:08:29

Hello, I was just attempting this questionhere and solved it by writing out this code here. However, my original thoughts on this question, were to write out a normal dp and then optimize it using matrix exponentiation, and then do binary search on all values of n. However, I got confused and I did not know how to do the optimization. Can someone please explain to me how this could be done?

Теги #matrix exponentialtion, #dp, #combinatorics, #binary search, #modular exponentiation

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский innoshark 2020-03-13 23:08:29 536 Initial revision (published)