Ohline and Awlean are greedy for toffees
CodeChefOpen on judge ↗
You are given 2 undirected trees with N nodes each. Each node has a toffee with a label of a number. You start at the root of both trees, that is node 1. At each turn you can do one of the following: - Move to an adjacent unvisited node in Tree 1 - Move to an adjacent unvisited node in Tree 2 - If it has a toffee, take out a toffee from your current node in Tree 1 and give it to Ohline - If it ha
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