12507 - Kingdoms

All about problems in Volume 125. 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
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

12507 - Kingdoms

Post by brianfry713 » Tue Sep 09, 2014 5:51 am

Use this thread to discuss this problem.
Check input and AC output for thousands of problems on uDebug!

Zyaad Jaunnoo
Experienced poster
Posts: 122
Joined: Tue Apr 16, 2002 10:07 am

Re: 12507 - Kingdoms

Post by Zyaad Jaunnoo » Mon Feb 08, 2016 8:23 pm

Using a bruteforce approach to solve this problem was enough.
2^n sets of towns to be connected using MST and keeping the best configuration, which is the cost <= K and the configuration having the most number of connected people.
This took around 0.103s.

As I can see runtimes of 0.03s as well, what approach was used?

Post Reply

Return to “Volume 125 (12500-12599)”