#C13853. Collaborative Project Management System

    ID: 43437 Type: Default 1000ms 256MiB

Collaborative Project Management System

Collaborative Project Management System

In this problem, you are asked to implement a collaborative project management system. The system manages projects, developers, and tasks. Your program should support five types of commands:

  • create <project_name>: Create a new project. If a project with the same name already exists, ignore the command.
  • add <developer_name> <project_name>: Add a developer to a project. A developer should not be added more than once to the same project.
  • assign <project_name> <task_name> <developer_name>: Assign a new task to a developer in the specified project. (Note: the developer is not automatically added to the project by this command.)
  • complete <project_name> <task_name>: Mark an assigned task as completed.
  • status <project_name>: Query the status of a project.

The status of a project is defined as follows:

[ \text{total_tasks} = \text{number of tasks assigned in the project},\quad \text{completed_tasks} = \text{number of tasks marked as completed},\quad \text{developers} = \text{list of unique developers (added using the add command) sorted in lexicographical order}. ]

Process all commands read from standard input and, when a status command is encountered, output the status information.

inputFormat

The first line of input contains an integer N, the total number of commands. Each of the following N lines contains one command in one of the following formats:

create <project_name> add <developer_name> <project_name> assign <project_name> <task_name> <developer_name> complete <project_name> <task_name> status <project_name>

It is guaranteed that the last command is a status query. All commands are read from standard input.

outputFormat

For the status command, output the project status on three separate lines:

  1. The first line contains the total number of tasks assigned.
  2. The second line contains the number of tasks that have been completed.
  3. The third line contains the list of developers (added via the add command) sorted in lexicographical order, separated by a single space.## sample
7
create ProjectA
add Alice ProjectA
add Bob ProjectA
assign ProjectA Task1 Alice
assign ProjectA Task2 Bob
complete ProjectA Task1
status ProjectA
2

1 Alice Bob

</p>