| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 11936 | (電機班上機考) The Cost of Shortest Paths |
|
Description
Given
- Number of matrix
- A matrix of digits
Task
- Convert the nonzero digits of the matrix into a graph
- The nonzero digits represent the weights of edges between two nodes
- Print out the cost of shortest path of each pair of nodes
Input
Matrix Specification
- Each cell in the matrix contains a digit value (ranged from 0 to 9)
- 0 represents no edge between two nodes
- Nonzero digits represents the weights of two node
- Take the following figure as an example
Output
- Print out the cost for each pair in row major order.
- Print a new line between matrices.