Graph Theory37 sections · 1633 units
Open in Course

Problem - Teleporters Path

CSES 1693 - Directed Euler path.

Problem: A game has nn levels with mm one-way teleporters. You start at level 11 and want to reach level nn using each teleporter exactly once.

Link: CSES 1693

Constraints:

  • 2n1052 \leq n \leq 10^5
  • 1m2×1051 \leq m \leq 2 \times 10^5

Output: A sequence of levels, or "IMPOSSIBLE" if no valid path exists.

Note: This is a directed Euler path problem, not a circuit.