← All problemsSign in

Construct Degree

CodeChefRating 3247Open on judge ↗

You are given an integer $N$. Count the number of distinct arrays $D$ of size $N$ containing non-negative integers such that it is possible to construct a graph $G$ of $N$ nodes with the following constraints: 1. For each $i$ ($1 \leq i \leq N$), node $i$ has degree $D_i$ in $G$. 2. $D_1 + D_2 + \ldots + D_N = 2N$. 3. $G$ is [simple](https://mathworld.wolfram.com/SimpleGraph.html), [connected](h

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