← All problemsSign in

Exact Walks

CodeChefRating 2312Open on judge ↗

Maui had an undirected connected graph $G = (V, E)$, where $V$ = {$v_1, v_2, \ldots, v_N$} and $E$ is the edge set. He also had a list of positive non-zero integers $a_1, a_2, \ldots ,a_N$. He was bored of his usual adventures and decided to build a new directed graph $G' = (U, F)$. $U$ = {$u_1, u_2, \ldots, u_N$} and $(u_i, u_j) \in F$ if and only if there is a walk of length exactly $a_i$ from $

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