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

Kitten on a Tree

ID: kitten

Difficulty: 1.8

CPU Time: 1 second

Memory: 1024 MB

Solution

Save the first number as the start/current, for each non-"-1" line, and map all b values to a. Then, until the current value == 0, output current, get the mapped lower-branch corresponding to current, and set current to this branch.

Clone this wiki locally