Data Structures & AlgorithmsHardICPC regional · Codeforces Div 2 D
Directed graph on vertices 0 to 5 with edges: 1→3, 2→1, 2→4, 3→2, 1→0, 1→5, 0→4, 3→5, 0→5, 0→1, 4→0, 5→3, 5→4, 5→1, 2→5, 2→3, 3→4. What is the smallest number of edges whose deletion makes vertex 5 unreachable from 0?
- A. 3
- B. 4
- C. 2
- D. 1
Correct answer: C. 2
By max-flow min-cut with unit capacities, the answer equals the maximum number of edge-disjoint paths from 0 to 5, which is 2. The source's out-edges (3) and the edges on one shortest path (1) are not cuts in general.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- Directed graph on vertices 0 to 6 with edges: 0→3, 4→0, 0→2, 2→5, 1→3, 2→1, 1→5, 0→6, 0→1, 5→2, 2→0, 4→6, 2→6, 5→0. What is the smallest…
- Directed graph on vertices 0 to 5 with edges: 4→5, 2→3, 1→5, 4→0, 0→4, 2→1, 3→4, 2→4, 5→4, 5→1, 5→3, 4→3, 1→2, 2→5, 0→3, 0→5. What is the…
- Directed graph on vertices 0 to 6 with edges: 2→4, 4→5, 6→2, 0→6, 5→4, 3→0, 0→4, 6→3, 3→6, 6→0, 0→5, 2→5, 3→5, 1→4, 5→0, 5→6, 2→6, 5→1…
- Directed graph on vertices 0 to 5 with edges: 4→5, 5→1, 3→4, 0→5, 5→3, 0→1, 2→1, 3→1, 5→0, 4→3, 3→5, 5→2, 0→3, 3→2, 2→0, 2→5, 2→3. What is…
- Directed graph on vertices 0 to 6 with edges: 4→6, 2→0, 0→5, 5→3, 4→1, 0→1, 3→0, 5→1, 3→5, 6→2, 0→6, 0→2, 0→3, 6→4, 2→3, 1→2, 1→6. What is…
- Directed graph on vertices 0 to 6 with edges: 6→5, 5→0, 0→4, 1→5, 1→0, 0→6, 1→2, 5→4, 4→2, 1→4, 5→1, 0→1, 5→6, 0→5, 2→1, 3→6, 0→2, 1→6…