← 返回 uber 的题目列表Alien Dictionary Evaluation
类型:online_judge
Perform division operations in an alien language environment, similar to the Evaluate Division problem. Given several division relationships and queries, return the result of each query. Each relationship is of the form a/b = value, where a and b are different strings, and value is a float. Return the result of query xy/z, or -1 if it cannot be determined.
Example
Input
[('a', 'b'), ('b', 'c')], [2.0, 3.0], [('a', 'c'), ('b', 'a'), ('a', 'e'), ('a', 'a')]