Page 1 of 1

Re: 1664 - Conquer a New Region

Posted: Thu Oct 16, 2014 8:49 am
by Repon kumar Roy
What Algorithm needed to use to solve this problem ?
Algorithm like Max Flow ?? I am not sure about ..

Re: 1664 - Conquer a New Region

Posted: Fri Oct 17, 2014 12:44 am
by brianfry713
It is similar to Kruskal's algorithm, but you'll need to add some logic to how you implement the union.

Re: 1664 - Conquer a New Region

Posted: Sat Oct 18, 2014 8:15 pm
by Repon kumar Roy
Yes , Kruskal and Condition to choose which one to be parent of other .... Trick to solve this problem .

WA? Use long long :D

Happy Coding ,, And thanks Brainfry

But in case of running time , my time is far far greater than you... :) How do you implement kruskal algorithm ?? Brainfry