11924 - Shorest Paths (edge+vertex version)
|
Time |
Memory |
| Case 1 |
1 sec |
32 MB |
| Case 2 |
1 sec |
32 MB |
| Case 3 |
1 sec |
32 MB |
| Case 4 |
1 sec |
32 MB |
| Case 5 |
1 sec |
32 MB |
| Case 6 |
1 sec |
32 MB |
| Case 7 |
1 sec |
32 MB |
| Case 8 |
1 sec |
32 MB |
| Case 9 |
1 sec |
32 MB |
| Case 10 |
1 sec |
32 MB |
Description
這題不是作業!
作業在 https://acm.cs.nthu.edu.tw/problem/11922
- Given
- Task
- Convert the nonzero digits of the matrix into a graph
- The nonzero digits represent the edge cost of edges between two vertics
- Find the shortest path between all pairs of vertics
- Print out the cost of shortest (lowest-cost) paths for each vertex pair (只需印 cost,不用印 path)
- Here path cost includes edges and vertics

Input
Matrix Specification
- Each cell in the matrix contains a digit value (ranged from 0 to 9)
- 0 represents no edge between two vertics
- Nonzero digits represents the weights of two vertics
- 100≥ Number of vertices (i.e., matrix width and height) ≥2

Output
Print out the cost of shortest paths with row major order for each pair
Tags