Skip to content

freefood

bradendubois edited this page Jun 9, 2021 · 6 revisions

Free Food

ID: freefood

Difficulty: 1.5

CPU Time: 1 second

Memory: 1024 MB

Solution

One can create a map of a day x, and for every event from s to t, mark all days between (and including) these in the map as having free food. After doing this for every event, simply iterate through the map from the earliest-starting event to the last-ending event, and if there is at least one event that has marked this day, increment a running total.

Clone this wiki locally