Special Fibonacci
CodeChefOpen on judge ↗
Sankalp recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers. He defined them as follows: - f(0) = a; - f(1) = b; - f(n) = f(n-1) ^ f(n-2); when n>1, where ^ denotes the bitwise xor operation. You are given three integers a,b and n , calculate f(n). Input The input
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