[SOLUTION] Reach Anywhere SOLUTION CODECHEF
Problem SOLUTION CODECHEF You are given a simple undirected graph with �N vertices and �M edges. Find the smallest non-negative integer �K such that for every vertex �u (1≤�≤�1≤u≤N), there exists a walk of length exactly �K from 11 to �u. If no such integer exists, print −1−1 instead. Notes: It is allowed to repeat both vertices and edges in a walk. The length of a walk equals the number of edges in it. Input … Read more