Skip to content

movingday

bradendubois edited this page Sep 10, 2021 · 8 revisions

Moving Day

ID: movingday

Difficulty: 2.7

CPU Time: 1 second

Memory: 1024 MB

Solution

For this, take in n and V, and keep some current representing the largest volume box seen so far. For each of the n boxes, up current if the given box's volume is larger than current. Afterwards, output current minus V.

Clone this wiki locally