Data Structures & AlgorithmsHardICPC regional · Codeforces Div 2 E

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

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

Correct answer: C. 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