Skip to main content

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.

Back to lesson: Practice: Mixed Drill — Structures and Graphs