The Infinite K-Tree
CodeChefOpen on judge ↗
Let's define an Infinite K-Tree as follows : - Each vertex has exactly K children - Each edge has some weight - There are Infinite number of nodes in the tree - K edges going out of a vertex has weights 1,2,3, ... K Below is an example of an Infinte 3-Tree (Only 3-Levels are shown) : Find out "How many paths of total weight N (the sum of all weights of the edges in the path) are there, start
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start