← All problemsSign in

Beyond Expectations

You are given an undirected simple graph $G$ with the set of its vertices $V$, consisting of $N$ vertices (numbered $1$ to $N$) and the set of edges $E$, having $M$ edges (numbered $1$ to $M$). Each edge $i$ has $2$ lists of vertices ($A_i$ and $B_i$) associated with it. These $2$ lists are not necessarily disjoint. For every subset $V_1$ of $V$, we define the special graph $G_1 ( V_1, E_1 )

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