Data Structures & AlgorithmsModerateICPC regional · Codeforces Div 2 E

Directed graph on vertices 0 to 8 with edges: 6→8, 5→7, 6→7, 3→1, 6→3, 3→8, 3→4, 1→0, 0→1, 8→4, 1→5, 7→3, 2→6, 3→6, 4→8. How many strongly connected components does it have (maximal sets in which every vertex can reach every other)?

  1. A. 1
  2. B. 0
  3. C. 2
  4. D. 3

Correct answer: D. 3

Vertices that can reach each other form one component, giving 3 groups in total. Ignoring edge directions gives only 1 weakly connected pieces, which is the usual slip.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic