← All problemsSign in

Group Activity

There is a group of N students numbered from 1 to N. Some of the students know each other.You are given this information by M pairs each of form (ai,bi) denoting that person ai and bi know each other. The professor wants to conduct a group activity and for this activity he needed either 2 or 3 group of students.The criteria of dividing the students in groups is that only those students who know a

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