Data Structures & AlgorithmsVery hardCodeforces Div 2 D

Directed graph on vertices 0 to 5 with edges: 0→1, 2→3, 5→0, 1→4, 4→1, 0→3, 0→2, 2→1, 4→3, 1→2. What is the number of vertices in the largest strongly connected component?

  1. A. 6
  2. B. 3
  3. C. 5
  4. D. 1

Correct answer: B. 3

The largest group in which every vertex reaches every other has 3 vertices. The set reachable from 0 (5 vertices) is not an SCC, and the largest weak component (6) ignores direction.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic