You are not logged in. Please login at to post your questions!


GOOGOL03 - Editorial

PROBLEM STATEMENT: Practice, Contest


PRE-REQUISITES: Depth First Search, Minimum Spanning Tree, Graph.

From the statement marked bold it was clear that you had to create a minimum spanning tree from the initial given graph.
Now using DFS we can calculate how many total numbers of nodes a particular node is connected to. This is done by choosing any node as a parent and then recursively calculating it.

Once this is done, to calculate the busyness for every node, we know that any particular node is connected to n-1 other nodes (directly or indirectly, because it was a connected graph). Also we know the adjacently connected nodes of a given node. Therefore, starting from any adjacent node we multiply its connectivity with the remaining number of nodes. Doing this for all the adjacent nodes will give you the final busyness for a particular node. (See the code for more clarity on this concept)

Author: Prayank Mathur
Tester: Naman Taneja
Editorialist: Prayank Mathur

This question is marked "community wiki".

asked 21 May '15, 16:25

surajjumpy's gravatar image

accept rate: 0%

edited 21 May '15, 18:03

admin's gravatar image

0★admin ♦♦

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 21 May '15, 16:25

question was seen: 927 times

last updated: 21 May '15, 18:03