#C2176. Employee Skill Management
Employee Skill Management
Employee Skill Management
You are given a series of operations to manage employees' skills. There are three types of operations:
- Type 1: Add a new skill to an employee. The operation is described as:
1 emp skill
. - Type 2: Remove a skill from an employee. The operation is described as:
2 emp skill
. - Type 3: Query and print all the skills of an employee in lexicographical order separated by a single space. If the employee has no skills, output
None
. The operation is described as:3 emp
.
For instance, if an employee has skills, the output should be sorted alphabetically. If not, output None
.
The operations obey the following constraints:
- Let \( n \) be the number of operations.
- Each operation is provided in a single line via standard input.
Implement a solution that reads from standard input and writes the required output to standard output.
inputFormat
The first line contains an integer \( q \), the number of operations. Following this, there are \( q \) lines, each describing an operation in one of the following formats:
- For adding a skill:
1 emp skill
- For removing a skill:
2 emp skill
- For querying skills:
3 emp
Here, emp
is the employee ID (an integer) and skill
is a string without spaces.
outputFormat
For each query operation (type 3), output the employee's skills in lexicographical order separated by a single space on a new line. If an employee has no skills, output None
(without quotes).
7
1 1 Coding
1 1 Design
1 2 Management
3 1
2 1 Design
3 1
3 2
Coding Design
Coding
Management
</p>