12507 - Kingdoms
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
12507 - Kingdoms
Use this thread to discuss this problem.
Check input and AC output for thousands of problems on uDebug!
-
- Experienced poster
- Posts: 122
- Joined: Tue Apr 16, 2002 10:07 am
Re: 12507 - Kingdoms
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?
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?