題意:
Because of a technical difficulty, price of an edge will be (sum of weights of all descendant nodes) × (unit price of the edge).這句話一直沒看懂。後面還以為是最小生成樹。
正確題意是:給一個無向圖,計算每個點到1節點的最短路徑(dis[i]) * 每個節點的weights之和。
注意:邊權值等要用__int64;無向圖;
#include
#include
#include
#include
#include