Sort 13 Discussions, By:
Please Login in order to post a comment
The editorial mentions that a matrix inverse is needed, but if we rearrange the recurrence slightly then we can get around the need for an inverse. We can start off with the inverse directly and then we only need to perform the matrix exponentiation.
Excuse me, but what is F(0)? Can I assume F(0)=1 ?
Hi, I have solved the question but finding it difficult to match the answeres using the modulo operator.
My question is to understand the right usage of the modulo operator. For example, consider the fibonacci series mentioned in the problem description. [n=2, k=6, [13,8], [1,1]] First, we will find F(4) using the recurrance equation. But in the recurrance equation, i have the term 10^9 + 7. So how do i find F(4) with F(5), F(6), C(1) and C(2) and the modulo operator.
Without the modulo operator, F(4) = ( F(6) - ((F(5)*C(1)) / C(2).
As i'am new to Competetive programming, i am unable to print the right answer using the modulo operator. Any help/suggestions will be greatly appreciated.
Is this possible to solve without looping k-n times? I'm obviously not calculating each F(K) more than once, but mathmatically it seems that each F(K) must be calculated down to F(0). If so, the #0 testcase seems unsolvable, at least in Python.
For reference, the attempt is timing out with k-n (1 billion - 50) loops, even when the loop is empty (passing).
Is python out of the question? Am I missing some pattern that allows me to skip iterations?
If you really want to find the best seed and make the right decision, then I would recommend to anyone who wants to use this cannabis seed bank https://herbiesheadshop.com/cannabis-seeds-usa/cannabis-seeds-iowa with fast shipping to iowa. Everything you need to know about growing cannabis for personal use can be found at the provided unique link, so I wish everyone the right decision as soon as possible.