← All problemsSign in

Edge Addition

CodeChefRating 2760Open on judge ↗

You are given a tree with $N$ nodes. For each unordered pair of distinct nodes $(i, j)$ such that there is no edge between nodes $i$ and $j$, we add an edge between these nodes with probability $1/2$. For each $i$ ($1 \le i \le N$), let $p_i$ be the probability that the resulting graph has exactly $i$ 2-edge-connected components and let $R_i = p_i \cdot 2^{(N-1)(N-2)/2}$. You should compute $R_

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