Skip to content

climbingworm

bradendubois edited this page Nov 24, 2021 · 8 revisions

Climbing Worm

ID: climbingworm

Difficulty: 2.3

CPU Time: 1 second

Memory: 1024 MB

Solution

For this problem, just simulate the climb! Keep a tally of climbs, and while the current height is less than the height specified, climb by a, increment number of climbs, check height again (breaking out of the loop if the height has been reached), rest and fall b.

Clone this wiki locally