← All problemsSign in

Maximum Score

CodeChefRating 1202Open on judge ↗

You are given a **binary** array $A$ of **even** length $N$. Initially your score is $0$. You need to perform the following operation exactly $\frac{N}{2}$ times: - Select an index $1 \leq i < |A|$; - Add $|A_i-A_{i+1}|$ to score; - Delete $A_i$ and $A_{i+1}$ from $A$ and concatenate the remaining elements of $A$ without changing the order. Note that after each operation, length of $A$ decrea

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start