Exit code
Professor X got lost in a maze of an ancient tomb in Egypt. While he was finding the way to escape, he got a message of the tomb builders on the old walls: - The code to open the exit door is the sequence C of n digits formed c1..cn (ci∈[0,9] ). - For every sequence C, combining with the given integers A,B, call: - h0=0 - hi=(hi-1×A+ci) mod B - The smallest sequence C (in lexicological order)
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