← 返回 roblox 的题目列表Customized Programming Challenge for Roblox Business
类型:online_judge
Given a set of product data, each product has a price and a sales quantity. Please calculate the total sales for each product and return the top N products with the highest sales. The algorithm should be efficient. Provide test cases for up to 10,000 products.
Example
Input
[{'Product1': (10, 100), 'Product2': (20, 50), 'Product3': (5, 200), 'Product4': (50, 10), 'Product5': (15, 60)}, 3]