Data Structures & AlgorithmsHardICPC regional · Codeforces Div 2 E

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

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

Correct answer: B. 4

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

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic