×

# A PROBLEM ON GRAPH-THEORY

 0 LINK TO THE PROBLEM ( http://codeforces.com/contest/216/problem/B ) I am not getting the logic ....I also tried to learn form others code but ...again m not getting their logic .here is the the link of a solution( http://codeforces.com/contest/216/submission/16612019 ) but i am not able to understand why the root() function is designed like this and how it works.. asked 24 Jun '17, 15:31 15●4 accept rate: 0%

 0 Read this complete article and I am sure You will get the idea of Root() function. I will solve this question after some time, then I will suggest you the approach.But I recommend you to read this article first.This will surely help you to solve many others problems too. answered 24 Jun '17, 15:50 241●7 accept rate: 9% I guess you have to print number of close loop in given graph,where number of students are node and given pair are edges. (24 Jun '17, 15:56) So basically root() function here tells you about close loop formed in given graph.This is concept is basically used in Kruskal algo to do the check for closed loop. (24 Jun '17, 15:56)
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×682
×185

question asked: 24 Jun '17, 15:31

question was seen: 337 times

last updated: 24 Jun '17, 16:04