Data Structures & AlgorithmsHardICPC regional · Codeforces Div 2 D
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 the smallest number of edges whose deletion makes vertex 6 unreachable from 0?
- A. 5
- B. 3
- C. 1
- D. 2
Correct answer: D. 2
By max-flow min-cut with unit capacities, the answer equals the maximum number of edge-disjoint paths from 0 to 6, which is 2. The source's out-edges (5) 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: 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…
- Directed graph on vertices 0 to 6 with edges: 2→5, 0→6, 2→4, 4→2, 1→0, 3→1, 3→6, 1→5, 3→5, 4→6, 6→2, 0→5, 2→1, 0→1, 4→1, 6→4, 1→6, 4→3…
- Directed graph on vertices 0 to 5 with edges: 0→4, 2→1, 0→5, 1→2, 5→1, 1→5, 3→0, 3→1, 5→4, 5→0, 2→5, 3→4, 0→2, 5→3, 3→5. What is the…
- Directed graph on vertices 0 to 5 with edges: 3→1, 3→2, 3→5, 3→4, 5→3, 1→0, 5→0, 0→4, 5→1, 1→5, 2→4, 3→0, 0→5, 0→3, 1→3, 2→5, 2→3. What is…
- Directed weighted graph on vertices A, D, C, E, F (source A, target F) with edges: A→D (5); A→C (6); C→D (-6); D→F (4); C→F (4); A→F (14)…
- Directed graph on vertices A, B, C, D, E, F with edges A→C, A→D, E→A, D→E, B→D, F→D, D→C, C→A, E→B, F→B (no weights). What is the number…