← All problemsSign in

H - How Odd

You are given a simple undirected graph $G$ with $N$ vertices and $M$ edges. It is further guaranteed that **every simple cycle$^\dagger$ in $G$ has even length**. Let $H$ denote the graph that is the *complement* of $G$ — that is, $H$ is a simple undirected graph on $N$ vertices which contains the edge $(u, v)$ if and only if $G$ does not contain $(u, v)$. Find any simple cycle in $H$ whose l

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