Skip to main content

Checkpoint — Coin Corridors at Scale

Challenge on lesson: Checkpoint — Collapse, Then Walk

CHALLENGE
Difficulty: advanced+25 XP

**Bài toán.** Same as the practice problem: one-way corridors, per-room coins, cycles allowed; maximize coins along one route from any start. **Constraints:** 1 ≤ n ≤ 200000; 1 ≤ m ≤ 300000; 0 ≤ coin ≤ 10^9. **Output:** one integer. A DAG-assuming DP will produce wrong (inflated) answers on cyclic inputs; the cycles must be collapsed first.

Back to lesson: Checkpoint — Collapse, Then Walk