How to solve this Fibonacci Problem — FRSKH?

Правка en1, от -synx-, 2017-12-02 17:17:38

SPOJ — FRSKH
The problem requires to efficiently compute

The constraints are:

I have solved the easier version with constraint on and same constrains on
M can be optimized using Pisano Period
N can be optimized using Fast Doubling/Matrix Exponentiation
The issue is constraint on K, which I cant figure a way to optimize. How can we resolve this issue?

Теги fibonacci, recurrence, pisano

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский -synx- 2017-12-02 17:17:38 614 Initial revision (published)