Grand son of Bonacci (TIEBREAKER)
CodeChefOpen on judge ↗
The famous Fibonacci sequence as you all know A1 = 1, A2 = 2, Ai = Ai-1 + Ai-2 (i > 2). Now we represent a natural number N by the maximum numbers that are less than or equal to N in Fibonacci sequence: N = b1*A1 + b2*A2 + … Hence N can be represented as: bnbn-1…b1. For eg, 1 = 1f, 2 = 10f, etc. On writing all N successively in Fibonacci system, we will obtain a sequence like this: 110… We call
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start