- ID : UVA - 11631 - Dark Roads
- Status : Accepted
- Type : Graph MST .
- Time : 30 Minutes to Submission.
- Language : Java
- Solution :
- Add Total Costs of Edges.
- Kruskal MST on Edges using Union-Find Algorithm
- Subtract the MST cost from the Total cost.
- Problems :
- Large Data Input so Buffered Reader & Scanner will give TLE
- Don't Use Java Standard Input readers but use this Parser Instead.
This Blog is a Personal record for All The Algorithms Problems I've Solved. It shouldn't be taken as a reference for optimal solutions because I'm just a beginner.
Monday, February 28, 2011
UVA - 11631 - Dark Roads
Labels:
11631,
Dark Roads,
Graph,
MST,
Uva,
UVA 11631 Dark Roads
Java Input Parser
This is a Fast Input Parser for Java Standard Input.
It's preferred to use this one instead of both Scanner & BufferedReader as your input reader
It's working for many problems and my recent one is UVa - 11631 - Dark Roads
Enjoy :) :)
this parser was implemented by Knightry
It's preferred to use this one instead of both Scanner & BufferedReader as your input reader
It's working for many problems and my recent one is UVa - 11631 - Dark Roads
Enjoy :) :)
this parser was implemented by Knightry
UVA - 10307 - Killing Aliens in Borg Maze
- ID : UVA - 10307 - Killing Aliens in Borg Maze
- Status : Accepted
- Type : Graph MST & BFS.
- Time : 5 Hours to Submission.
- Language : Java
- Solution :
- Assume 'S' is a normal node as 'A'
- BFS on all Nodes and Find all Edges.
- Kruskal MST on Edges using Union-Find Algorithm
- Problems :
- hashCode() Function shouldn't be implemented without equals()
- Hashing should be avoided with pre-indexing.
Subscribe to:
Posts (Atom)