Skip to content

sodaslurper

bradendubois edited this page Sep 10, 2021 · 7 revisions

Soda Slurper

ID: sodaslurper

Difficulty: 1.6

CPU Time: 1 second

Memory: 1024 MB

Solution

One can add e and f to be the total number of bottles collected, and e / c will be the number that Tim can buy, so one stores e % c (bottles that are not enough to buy another soda), e is divided by c and added to a total, and the remaining bottles are added back to the total. This is repeated until e is no longer >= c.

Clone this wiki locally