21662_PersonnelScheduling

2022-5-16 18:20| 发布者: Hocassian| 查看: 23| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505736541400-Problem List-采集的数据-后羿采集器.html

Pro.ID

21662

Title

Personnel Scheduling

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21662

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    personnel scheduling has been widely studied for many years. The scheduling can be thought of as the problem of assigning employees to shifts or duties over a scheduling period so that certain constraints are satisfied or the assignment achieved some objective.

    In this problem, we focus on a basic personnel scheduling system. Suppose there is a small workshop which manufactures accessory for some special tools. This time, the workshop received a series of order forms in a day. Each order form gives out a period of time. For an order form, the workshop owner has to recruit one laborer to manipulate the machine. In this period, other order forms cannot distract the laborer. But when the laborer finished his current work, he can take over another order form.

    To minimize the cost, the workshop owner wants to recruit least amount of the laborers. Besides, he has to consider the work-time balance among the laborers — the deviation of the work-time of each laborer should also be minimal. The definition of the deviation D is that, suppose there are m laborers and their work-times are w1, w2, ..., wm, then

    Your task is to work out the minimum number of laborers to be recruited and the minimum deviation between these laborers.

    输入

    The first line of the input gives out the number T ( T ≤ 100 ) of test case. For each test case, the first line is an integer N ( 1 ≤ N ≤ 20 ), representing the number of the order form. The following N lines each line contains two timestamps, "start-time" and "end-time". The format of a time forms "HH:MM" ( 0 ≤ HH < 24,  0 ≤ MM < 60 ). A laborer should be assigned to this period of time, start-time and end-time inclusive.

    输出

    Description

    personnel scheduling has been widely studied for many years. The scheduling can be thought of as the problem of assigning employees to shifts or duties over a scheduling period so that certain constraints are satisfied or the assignment achieved some objective.

    In this problem, we focus on a basic personnel scheduling system. Suppose there is a small workshop which manufactures accessory for some special tools. This time, the workshop received a series of order forms in a day. Each order form gives out a period of time. For an order form, the workshop owner has to recruit one laborer to manipulate the machine. In this period, other order forms cannot distract the laborer. But when the laborer finished his current work, he can take over another order form.

    To minimize the cost, the workshop owner wants to recruit least amount of the laborers. Besides, he has to consider the work-time balance among the laborers — the deviation of the work-time of each laborer should also be minimal. The definition of the deviation D is that, suppose there are m laborers and their work-times are w1, w2, ..., wm, then

    Your task is to work out the minimum number of laborers to be recruited and the minimum deviation between these laborers.

    Input

    The first line of the input gives out the number T ( T ≤ 100 ) of test case. For each test case, the first line is an integer N ( 1 ≤ N ≤ 20 ), representing the number of the order form. The following N lines each line contains two timestamps, "start-time" and "end-time". The format of a time forms "HH:MM" ( 0 ≤ HH < 24,  0 ≤ MM < 60 ). A laborer should be assigned to this period of time, start-time and end-time inclusive.

    Output

    For each test case, output a line with two number m and D. D is rounded to 2 decimal places.

    Sample Input

    2
    2
    01:00 02:00
    02:00 02:00
    5
    00:00 00:00
    15:13 15:58
    03:38 04:42
    03:15 13:56
    13:03 21:50

    Sample Output

    2 0.00
    2 47.00

    Source

    样例输入

    2
    2
    01:00 02:00
    02:00 02:00
    5
    00:00 00:00
    15:13 15:58
    03:38 04:42
    03:15 13:56
    13:03 21:50

    样例输出

    2 0.00
    2 47.00

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部