Estate In Hand
CodeChefOpen on judge ↗
There are $N$ businessmen from $0$ to $N - 1$ who are ready to invest in real estate. Some of them are friends and thus form a group. You have been given $M$ facts that businessmen $u$ and $v$ are friends. The same fact can be given multiple times. If $X$ and $Y$ are friends and $Y$ and $Z$ are friends, then it is always true that $X$ and $Z$ are also friends. You have been given $N$ real estate
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