← All problemsSign in

Fibonacci Number

CodeChefRating 2715Open on judge ↗

Problem Statement As we know, Fibonacci Number is defined as Fn=n if n ≤ 1 Fn=Fn-1+Fn-2, otherwise Now this problem is quite simple: you are given one prime number P and one non-negative integer C You are expected to find the smallest non-negative integer n, such that Fn≡C(mod P) The definition of "mod" could be found here: here Input The first line of the input contains an

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start