Variation 1: The Round Table
Challenge on lesson: Checkpoint — Editorial Calibrated
CHALLENGE
Difficulty: advanced+25 XP
**Bài toán.** Same market rules, but the stalls are arranged in a **circle**: stall n is adjacent to stall 1. Choose a non-adjacent subset with maximum total revenue. **Constraints:** 2 ≤ n ≤ 200000; 0 ≤ a[i] ≤ 10^6. **Input:** line 1: n; line 2: n values. **Output:** one integer.
Press Submit to check your solution.
Back to lesson: Checkpoint — Editorial Calibrated