1 /*
2 Problem link
3 Type: Graph - Single source shortest path
4 Algorithm:
5 First run Floyd (or Dijkstra to every vertex n), for each vertex
6 find the distance to the nearest station, get the max of those nearest station.
7
8 For the vertex which is not a station, place a station there and run Dijkstra
9 for that vertex. Recalculate the distance to the nearest station for each vertex
10 by the distance array from the Dijkstra and update the for the "better max".
11 */
Introduction
This is my blog of programming, I take notes and leave codes of computer science problems I solved here. Be my guest to comment :)
Wednesday, January 30, 2013
uva 10278 - Fire Station
Wednesday, January 23, 2013
Tuesday, January 22, 2013
uva 1208 - Oreon
1 /*
2 Problem link
3 Type: Graph
4 Algorithm: MST
5 */
Saturday, January 19, 2013
uva 908 - Re-connecting Computer Sites
1 /*
2 Problem link
3 Type: Graph
4 Algorithm: MST
5 */
Thursday, January 17, 2013
uva 299 - Train Swapping
1 /*
2 Problem link
3 Type: Ad hoc, Sorting.
4 Algorithm: Insertion Sort.
5 */
Monday, January 7, 2013
Wednesday, January 2, 2013
uva 821 - Page Hopping
1 /*
2 Problem link
3 Type: Graph
4 Algorithm:
5 Use floyd to find all pair shortest path, sum them up, divide to the number of pair
6 I use the map to mark for the vertex in the input.
7 */
Tuesday, January 1, 2013
uva 423 - MPI Maelstrom
1 /*
2 Problem link
3 Type: Graph
4 Algorithm:
5 Use Floyd or Dijkstra to find the shortest path from 1 to n-1 others nodes.
6 Find the max of the shortest path from 1 to n-1 others nodes.
7 */
Subscribe to:
Posts (Atom)