← 返回 amazon 的题目列表Get Data Dependence Sum
类型:online_judge
In a software system, several processes have data dependency relations. Given a Directed Acyclic Graph (DAG) where nodes represent processes and edges represent dependencies and their dependency amounts, design an algorithm to compute the maximum dependency sum among all processes. Input: A DAG with edges including two nodes and a dependency amount. Output: The maximum sum of dependencies.
Example
Input
4
0 1 10
0 2 20
1 3 30
2 3 30