Data Structures & AlgorithmsVery hardICPC regional · Codeforces Div 2 E

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

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

Correct answer: A. 5

Vertices that can reach each other form one component, giving 5 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