Editorial for Taofiq the House Prefect

The main purpose of this problem is to identify the phone calls among two people. First, we have to consider the roll number as nodes, and the friendship among any two members as edges. If we start a Breadth First Search from node 0, at the end we will find a BFS tree. While exploring the neighbour nodes, we have to explore them in ascending order, to get an unique BFS tree. Then we will just store the edge of the BFS tree and for any query, if there is an edge between a and b in the BFS tree, we will print “Yes” and “No” otherwise.

    Statistics


    89% Solution Ratio

    mohanr7073Earliest, 4M ago

    raynor30Fastest, 0.1s

    Md_Siam07Lightest, 6.3 MB

    Tahmid690Shortest, 916B