How to solve uva 11651 ( Krypton Number System) ??

Revision en2, by Secret.Codes, 2017-07-15 18:01:01

Problem link: https://uva.onlinejudge.org/external/116/p11651.pdf . I know how to convert it to matrix exponentiation, On my solution the matrix is 77*77 size. as there are 200 test case and the matrix may be powered to 10^9 , It will case time limit exceed though O(n^3log(m)). How to make it time efficient ??

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Secret.Codes 2017-07-15 18:01:01 25
en1 English Secret.Codes 2017-07-15 17:59:23 342 Initial revision (published)