An Old Machine (challenge)
CodeChefOpen on judge ↗
Tyrion found a unique machine while exploring the streets of old town. This machine had only a display, an increment switch, and a decrement button. At the time, an integer $N$ was being displayed. Pressing the increment switch increases the current number being displayed on screen by $1$. Similarly, pressing the decrement switch decreases the current number being displayed on the screen by
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