← 返回 snowflake 的题目列表Determine Employees to Promote
类型:online_judge
Given a list of employees with their project contribution scores, compute the total contribution for each employee across all projects, then sort the employees by their contribution score, identifying the top employees for promotion. The number of employees that can be promoted is determined by a given promotion ratio. Employee information includes their name and contributions to various projects. Output the list sorted by contribution in descending order and the list of employees identified for promotion (may include multiple employees).
Input
List of employee information: Contains each employee's name and contribution scores for each project. Promotion ratio: The proportion of employees eligible for promotion.
Output
List of employees sorted by contribution scores and a list of employees identified for promotion.
Test Cases
Input: [
{'name': 'Alice', 'project_contributions': [10, 20, 30]},
{'name': 'Bob', 'project_contributions': [20, 30, 40]},
{'name': 'Charlie', 'project_contributions': [40, 10, 20]}
], 0.33
Output: Sorted list - Bob, Charlie, Alice; Promotion list - Bob
Example
Input
{"employees": [{"name": "Alice", "project_contributions": [10, 20, 30]},{"name": "Bob", "project_contributions": [20, 30, 40]},{"name": "Charlie", "project_contributions": [40, 10, 20]}], "promotion_ratio": 0.33}