CF1701C Schedule Management
题目描述
## 题意简述
有 $n$ 个工人和 $m$ 个任务,每个任务都有且仅有一个工人擅长做,如果让擅长做的工人去做,那么要花一个单位时间,否则要花两个单位时间。请问完成所有的任务至少要花多少时间。
注意:每项工作只能由一个工人完成,不能合作完成。
输入格式
无
输出格式
无
说明/提示
In the first testcase, the first worker works on tasks $ 1 $ and $ 3 $ , and the second worker works on tasks $ 2 $ and $ 4 $ . Since they both are proficient in the corresponding tasks, they take $ 1 $ hour on each. Both of them complete $ 2 $ tasks in $ 2 $ hours. Thus, all tasks are completed by $ 2 $ hours.
In the second testcase, it's optimal to assign the first worker to tasks $ 1, 2 $ and $ 3 $ and the second worker to task $ 4 $ . The first worker spends $ 3 $ hours, the second worker spends $ 2 $ hours (since they are not proficient in the taken task).
In the third example, each worker can be assigned to the task they are proficient at. Thus, each of them complete their task in $ 1 $ hour.