← 返回 meta 的题目列表Power Function and Top K Elements
类型:online_judge
Implement a function to compute x raised to the power y with a time complexity of O(log y). Also, find the top k largest numbers from a given n numbers. Assume the input is two strings: the first string contains x and y separated by a space, and the second string contains n numbers followed by k, separated by spaces. Constraints: -100 < x < 100, -10^9 < n[i] < 10^9, 0 ≤ k ≤ n.
Example
Input
2 3
3 1 4 1 5 9 2 6 5 3 5 7 3