← All problemsSign in

Bitsetbaba and Power Grid

CodeChefRating 2426Open on judge ↗

Bitsetbaba Ashiq works in a power grid, which consists of $2^K$ power stations (numbered $0$ through $2^K-1$). Initially, there are no connections between the power stations. One day, Ashiq's boss gave him $M$ integers $x_1, x_2, \ldots, x_M$ and asked Ashiq to add connections between some power stations. For each two different power stations $u$ and $v$, Ashiq should connect them directly if t

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