Given a directed graph with vertices and arcs, we wish to know if there is a directed path between two given vertices.
Input starts with i . Then follow pairs , with , indicating an arc from to . We have that and and there are no repeated arcs. Then follows, a pair with and .
Write “yes” o “no” according to whether
there is or not a path from
to
.
Author: Jordi Petit
Translator: Jordi Petit
Generation: 2026-01-25T11:22:50.547Z
© Jutge.org, 2006–2026.
https://jutge.org