Practice · 2 of 3
Cyclic Harvest
CHALLENGE
Difficulty: advanced+25 XP
**Problem.** A circular field of n plots with yields a[i] (may be negative). Choose a non-empty contiguous arc maximizing the total yield. Print that maximum. **Constraints:** 1 <= n <= 200000; |a[i]| <= 1e4. The seam is the whole problem: the best arc may wrap.
Press Submit to check your solution.
Back to lesson: Practice: Mixed Drill — Structures and Graphs