Skip to content
bradendubois edited this page Oct 7, 2021 · 8 revisions

Bus

ID: bus

Difficulty: 1.6

CPU Time: 1 second

Memory: 1024 MB

Solution

Since the total will halve every time, plus an additional half a passenger (which would effectively be 0.5 + 0.25 + ... as it goes on), to reverse the number being halved k times, one can simply take 2 ^ k, and subtract 1.

Clone this wiki locally