Maximum Subsequence Sum
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.
Sign in to chat with the tutor and save your progress.
Sign in to start