Three Operations
CodeChefOpen on judge ↗
Palermo along with other heist members is given an integer sequence of length $N$ which is $[a_1, a_2, ...., a_n]$. You are also given an integer $K$. For each $a_i$ $[1 \leq i \leq N]$, you can perform *any one* of the following operations: - Add $K$ to $a_i$, or - Subtract $K$ from $a_i$, or - Do nothing (keep the element unchanged). After these operations, you select a number $Y$ and find
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