← All problemsSign in

Infinite Graph

CodeChefRating 2596Open on judge ↗

There is a graph of infinite size. The vertices of the graph are integers from negative infinity to positive infinity. Each vertex has a label (It can be empty too). Every label is an array of positive integers. For every integer x in u's label, there is a directed edge from u to (u + x). There can be multiple edges connecting any 2 vertices. The labels are periodic with period n. So label of ve

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