Skip to content

Latest commit

 

History

History

TREEWALK

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Walk over a tree

Problem code: TREEWALK | Time: 1.00 s | Memory: 32 MB | Solved: no | print

Given is a tree on n nodes. A person is currently standing in node number 1. In a single step, the person can move from its current node to any adjacent node. You are given an integer L. The person is allowed to make at most L steps. Find the maximum number of nodes the person can visit during the walk. Node 1 (where the walk starts) and the node where the walk ends count as visited. Each visited node is only counted once, even if it is visited multiple times.

Wej