Those who want proof of Fib(A+B) (Fibonacci shifting property) here it is!
can anyone explain what we store in the node.sfibm1 and node.sfibp1 of a non-leaf node? I am able to understand what we store in node.sfib⌠but canât able to understand the other two values stored⌠plz replyâŚ
Can this be solved using the golden ratio?
To partially answer your question: the interval multisets are not generated, itâs not necessary. CombineIntervalInfo will calculate the correct answer, but I donât understand how. Specifically I donât understand how âF(A+B) = F(A).F(B+1) + F(A-1).F(B)â can be applied to Sum(F(Sum(s))) for s in multisets.
Here is an example where I computed the combination of [3, 4] and [1,2] and then [3, 4, 1, 2] separately, just to confirm it works: https://i.imgur.com/UwakZCg.jpg
Can anyone explain how they are finding the sum of individual subsets in a given range?
please give link to your code
may be not solvable also in given time or either lazy propogation also required ?
can you explain solution ideaâŚif this problem has range update also?
Excellent problem ,Poor editorial , with no explanation for Combineintervalinfo functionâŚ!! , it feels like like editorial wants us to digest us the solution without any explanationâŚ!!
They are the sum over the same Fibonacci values as for node.sfib, but decreased by 1 (for node.sfibm1) or increased by 1 (for node.sfibp1). For instance, if node.sfib is Fibonacci(7)+Fibonacci(3)+Fibonacci(10), then node.sfibm1=Fibonacci(7-1)+Fibonacci(3-1)+Fibonacci(10-1) and node.sfibp1=Fibonacci(7+1)+Fibonacci(3+1)+Fibonacci(10+1).
thanks⌠for reply i have figured out
Thank you Sir, for such a neat code. Wish everyone would write code of this clarity. (Y)