1664 - Conquer a New Region

All about problems in Volume 16. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Repon kumar Roy
Learning poster
Posts: 96
Joined: Tue Apr 23, 2013 12:54 pm

Re: 1664 - Conquer a New Region

Post by Repon kumar Roy » Thu Oct 16, 2014 8:49 am

What Algorithm needed to use to solve this problem ?
Algorithm like Max Flow ?? I am not sure about ..

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 1664 - Conquer a New Region

Post by brianfry713 » Fri Oct 17, 2014 12:44 am

It is similar to Kruskal's algorithm, but you'll need to add some logic to how you implement the union.
Check input and AC output for thousands of problems on uDebug!

Repon kumar Roy
Learning poster
Posts: 96
Joined: Tue Apr 23, 2013 12:54 pm

Re: 1664 - Conquer a New Region

Post by Repon kumar Roy » Sat Oct 18, 2014 8:15 pm

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

Post Reply

Return to “Volume 16 (1600-1699)”