Virat and Astrologer
CodeChefOpen on judge ↗
Ahead of World cup, Virat Kohli goes to a genius astrologer who gives him a tree with N nodes whose every node specifies the runs Virat scores in a match. Virat wants to play as many matches in this world cup as possible. Any path from node x1 to xP denotes his score in successive matches in world cup. Let the path be x1,x2,x3,...,xP, so Virat wants to find the largest path such that the runs sco
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