← All problemsSign in

Maximum Subsequence Sum

CodeChefRating 2388Open on judge ↗

Chef has a machine which he uses to rotate sequences. If he puts a sequence $S_1, S_2, \ldots, S_N$ into the machine, it produces the sequence $S_2, S_3, \ldots, S_N, S_1$, i.e. the first element of the sequence is moved to the end. Chef is definitely not a newbie ― he knows about trivial things like finding the maximum sum of a contiguous subsequence. Therefore, he now made a difficult problem

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