Interesting Fibonacci Series
CodeChefOpen on judge ↗
$The$ $Fibonacci$ $numbers$ $were$ $first$ $described$ $in$ $Indian$ $mathematics$ $as$ $early$ $as$ $200$ $BC$. Inspired from this, Karthik creates his own Fibonacci series as defined below: $f(0) = a$ $f(1) = b$ $f(n) = f(n-1) \oplus f(n-2)$, $n \geq 2$, where $\oplus$ is the bitwise $XOR$ operator. You are given three integers $a$, $b$ and $n$, calculate $f(n)$. ### Input - The first line
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