The Final Problem
CodeChefOpen on judge ↗
Sherlock and Moriarty have come face to face. Moriarty claims he holds the key to unlock anything in the world, and given Sherlock a challenge to find the key. Sherlock, from his obvious-to-him inferences has found the information below. Help him find the key. Given NUM, K, C and M, output the sum (modulo M) of (d^K + C) where d is a positive integer in the range [1,N] and N when divided by d gi
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