1468 - DS_18_CHEN_quiz4 (CS2351) Scoreboard

Time

2018/05/23 18:02:00 2018/05/23 20:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11934 All Pair Shortest Paths - Cost

11934 - All Pair Shortest Paths - Cost   

Description

  • Convert the nonzero digits of the matrix into a graph
  • Print out the shortest path of each pair of nodes and cost.
  • Each cell in the matrix contains a digit value (ranged from 0 to 9)
    • 0 represents no edge between two nodes
  • Nonzero digits represent the weights of two node

 

Input

  • Number of matrices
  • Given the number of vertices.
    • 1 ≦ Number of vertices ≦ 100
  • A matrix contains a digit value (ranged from 0 to 9)
    • 0 represents no edge between two nodes

          

Output

  • Print out the cost for each pair in row major order.
    • Cost(from,to):xxx
  • Print a new line between matrices.

            

Sample Input  Download

Sample Output  Download

Tags




Discuss