## Mock CCC '18 Contest 5 J5/S3 - Directed Graph Connectivity

View as PDF

Points: 7 (partial)
Time limit: 0.6s
Memory limit: 1G

Problem type

Given a directed graph of vertices and edges, determine for each edge if it is possible to reach vertex from vertex given that that edge is deleted from the graph.

#### Input Specification

The first line of the input contains two space-separated integers, and .

Each of the next lines contains two space-separated integers, and , indicating that the th edge goes from vertex to .

You may assume that any given tuple appears at most once.

#### Output Specification

Output lines.

On the th line, given that the th edge is deleted, print YES if it is still possible to reach vertex from vertex . Print NO otherwise.

#### Sample Input

3 3
1 2
2 1
2 3

#### Sample Output

NO
YES
NO

• commented on Aug. 15, 2018, 8:47 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on Jan. 26, 2020, 9:39 a.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on Jan. 24, 2021, 9:48 a.m. edited

.