Find Components(keteki)
CodeChefOpen on judge ↗
There is an undirected acyclic graph as an adjacency matrix. Since it is undirected, if there is a path from node i to node j then there is a path from node j to node i too. However an algorithm A has been run on the graph such that if there is a path between two nodes of the graph, then the adjacency matrix will show a 1. There is no path to self. For example, the following graph with 3 nodes,
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start