← All problemsSign in

Restore Communication

CodeChefRating 2830Open on judge ↗

There are $N$ people lost in a forest, and each person has a radio. The $i$-th person's radio can transmit $K_i$ frequencies. Let the list of frequencies that the $i$-th person can transmit be $F_i = [f_{(i,1)}, f_{(i,2)}, \ldots, f_{(i, K_i)}]$. The $i$-th person and $j$-th person can communicate with each other if **at least** one of the following holds true: 1) They can both transmit a common

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start