non-negative integers, where F0=0, F1=1 and for each integer n≥2, Fn=Fn−1+Fn−2.
Consider the sequence D of the last decimal digits of the first N Fibonacci numbers, i.e. D=(F0%10,F1%10,…,FN−1%10). Now, you should perform the following process:
Let D=(D1,D2,…,Dl).
If l=1, the process ends.
Create a new sequence E=(D2,D4,…,D2⌊l/2⌋). In other words, E is the sequence created by removing all odd-indexed elements from D.
Change D to E.
When this process terminates, the sequence D contains only one number. You have to find this number.
can someone pls help me with this? i was able to solve it via recursion but the time limit is exceeding for cp
Isn't this a repost?
Code chef?
Look up on Memoization
Обсуждают сегодня