10183_JobProcessing

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

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

Pro.ID

10183

Title

Job Processing

Title链接

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

AC

4

Submit

5

Ratio

80.00%

时间&空间限制

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

    A factory is running a production line that requires two operations to be performed on each job: first operation "A" then operation "B". Only a certain number of machines are capable of performing each operation.

    Figure 1 shows the organization of the production line that works as follows. A type "A" machine takes a job from the input container, performs operation "A" and puts the job into the intermediate container. A type "B" machine takes a job from the intermediate container, performs operation "B" and puts the job into the output container. All machines can work in parallel and independently of each other, and the size of each container is unlimited. The machines have different performance characteristics, a given machine requires a given processing time for its operation.

    Give the earliest time operation "A" can be completed for all N jobs provided that the jobs are available at time 0. Compute the minimal amount of time that is necessary to perform both operations (successively, of course) on all N jobs.

    输入

    Multiple test cases. For each case:

    Line 1:   Three space-separated integers:

    • N, the number of jobs (1 ≤ N ≤ 1000).

    • M1, the number of type "A" machines (1 ≤ M1 ≤ 30)

    • M2, the number of type "B" machines (1 ≤ M2 ≤ 30)

    Line 2..etc: M1 integers that are the job processing times of each type "A" machine (1..20) followed by M2 integers, the job processing times of each type "B" machine (1..20).

    输出

    Description

    A factory is running a production line that requires two operations to be performed on each job: first operation "A" then operation "B". Only a certain number of machines are capable of performing each operation.

    Figure 1 shows the organization of the production line that works as follows. A type "A" machine takes a job from the input container, performs operation "A" and puts the job into the intermediate container. A type "B" machine takes a job from the intermediate container, performs operation "B" and puts the job into the output container. All machines can work in parallel and independently of each other, and the size of each container is unlimited. The machines have different performance characteristics, a given machine requires a given processing time for its operation.

    Give the earliest time operation "A" can be completed for all N jobs provided that the jobs are available at time 0. Compute the minimal amount of time that is necessary to perform both operations (successively, of course) on all N jobs.

    Input

    Multiple test cases. For each case:

    Line 1:   Three space-separated integers:

    • N, the number of jobs (1 ≤ N ≤ 1000).

    • M1, the number of type "A" machines (1 ≤ M1 ≤ 30)

    • M2, the number of type "B" machines (1 ≤ M2 ≤ 30)

    Line 2..etc: M1 integers that are the job processing times of each type "A" machine (1..20) followed by M2 integers, the job processing times of each type "B" machine (1..20).

    Output

    For each case, output a single line containing two integers: the minimum time to perform all "A" tasks and the minimum time to perform all "B" tasks (which require "A" tasks, of course).

    Sample Input

    5 2 3
    1 1 3 1 4

    Sample Output

    3 5

    Source

    样例输入

    5 2 3
    1 1 3 1 4

    样例输出

    3 5

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部