Skip to main content

Capstone: The Relief Drone

Challenge on lesson: Capstone — The Relief Drone

CHALLENGE
Difficulty: advanced+25 XP

**Bài toán.** A relief drone flies from the top-left cell to the bottom-right cell of an n×n grid of supply values, moving only right or down. It collects the value of every cell it enters. Its cargo bay can **discard exactly one cell's haul** along the way (turn one entered cell's value into 0; at most once per trip, optional). Maximize the collected total; print it. **Constraints:** 2 ≤ n ≤ 300; −100 ≤ grid[i][j] ≤ 100. **Input:** line 1: n; then n lines of n values. **Output:** one integer.

Back to lesson: Capstone — The Relief Drone