Secret Messages
CodeChefOpen on judge ↗
Consider N students of IIT - Jodhpur. Each student i belongs to a batch B[i] where 1 ≤ B[i] ≤ N. Some batches may be empty because of unavailability of students. You are given N - 1 connections where a connection between student i and student j signifies that student i can send some message to student j and vice versa. It is guaranteed that path between any two students i and j is unique. Now, ea
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