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 the value of and the names of the vertices. Then comes the value of and follow the arcs, made up by the name of two vertices, without repetitions nor autoloops. Then follows a pair of vertices . You can assume that and belong to the graph.
Write “yes” o “no” according to whether
there is or not a path from
to
.
Author: Jordi Petit
Generation: 2026-01-25T10:31:41.683Z
© Jutge.org, 2006–2026.
https://jutge.org