Odd Sum
Given an integer $N$, consider all arrays $A$ of size $N$ such that: - All the elements are non-negative and distinct. - All prefix sums are odd. Formally, for all $i$ such that $1 \le i \le N$, $\sum_{j=1}^i A_j$ is odd. Among all possible arrays $A$, output the smallest possible sum of the elements of the array. **Note**: Since the Input/Output may be large, it is preferred to use fast I/O.
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