CCC 2026 J4 – Snail Path Solution & Analysis
Simulate the snail step by step, track slimy squares with a visited set, and count every revisit.
Simulate the snail step by step, track slimy squares with a visited set, and count every revisit.
Use interval coverage, a difference array, and prefix sums to answer illumination queries efficiently.