Skip to main content

Practice · 5 of 5

Coin Corridors

CHALLENGE
Difficulty: advanced+25 XP

**Bài toán.** One-way corridors between n rooms; room i holds coin[i]. Walking a corridor is free. Starting anywhere, collect coins of every room you enter (each room counts once per visit-route). Maximize coins collected along one route. **Constraints:** 1 ≤ n ≤ 100000; 1 ≤ m ≤ 200000; 0 ≤ coin ≤ 10^9. Cycles may exist. **Output:** one integer.

Back to lesson: Practice: Combination Drill — Five Fusions