Equalize Juice
Chef is hosting a party. In preparation, he has laid out $N$ glasses of juice on a table, all in a line. The $i$-th glass from the left initially has $A_i$ units of juice. For aesthetic reasons, Chef would really like all the glasses to have an equal amount of juice. To achieve this, he can do the following: - Choose an index $i$ ($1 \leq i \leq N$). - Choose two **non-negative integers** $x$
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