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 and . Then follow pairs , with , indicating an arc from to . We have that and and that there are no repeated arcs. Then follows a pair , with and .
Write “yes” or “no” according to whether there is a path from to .
We are authorized to employ the NetworkX library.
Author: José Luis Balcázar, based on problem P56483 by Jordi Petit
Generation: 2026-01-25T14:36:17.396Z
© Jutge.org, 2006–2026.
https://jutge.org