← All problemsSign in

Maximize the NOSS

CodeChefRating 2677Open on judge ↗

You are given a sequence of positive integers $a_1, a_2, \ldots, a_N$. You may change up to two elements of this sequence, each of them to any positive integer (not necessarily the same for two elements). Let's denote the resulting sequence by $b_1, b_2, \ldots, b_N$. Consider all $2^N$ subsequences of $b_1, b_2, \ldots, b_N$. For each subsequence, compute the sum of its elements ($0$ for the emp

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