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

×

A PROBLEM ON GRAPH-THEORY

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

popo_popo333's gravatar image

3★popo_popo333
154
accept rate: 0%

edited 24 Jun '17, 15:33


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.

link

answered 24 Jun '17, 15:50

ayushagg31's gravatar image

1★ayushagg31
2417
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) ayushagg311★

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) ayushagg311★
toggle preview
Preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×682
×185

question asked: 24 Jun '17, 15:31

question was seen: 337 times

last updated: 24 Jun '17, 16:04