22705_Taskschedule

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

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

Pro.ID

22705

Title

Task schedule

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    There are n preemptive jobs to be processed on a single machine. Each job j has a processing time pj and deadline dj.  Preemptive constrains are specified by oriented graph without cycles. Arc(i, j) in this graph means that job i has to be processed before job j. A solution is specified by a sequence of the jobs. For any solution the completion time Cj is easily determined.

    The objective is to find the optimal solution in order to minimize

    max { Cj - dj , 0 }.

    输入

    The first line contains a single integer n, 1 ≤ n ≤ 50000. Each of the next n lines contains two integers pj and dj, 0 ≤ pj ≤ 1000,  0 ≤ dj ≤ 1000000, separated by one or more spaces. Line n+2 contains an integer m (number of arcs), 0 ≤ m ≤ 10×n. Each of the next m lines contains two integers i and j, 1 ≤ i, jn.

    输出

    Description

    There are n preemptive jobs to be processed on a single machine. Each job j has a processing time pj and deadline dj.  Preemptive constrains are specified by oriented graph without cycles. Arc(i, j) in this graph means that job i has to be processed before job j. A solution is specified by a sequence of the jobs. For any solution the completion time Cj is easily determined.

    The objective is to find the optimal solution in order to minimize

    max { Cj - dj , 0 }.

    Input

    The first line contains a single integer n, 1 ≤ n ≤ 50000. Each of the next n lines contains two integers pj and dj, 0 ≤ pj ≤ 1000,  0 ≤ dj ≤ 1000000, separated by one or more spaces. Line n+2 contains an integer m (number of arcs), 0 ≤ m ≤ 10×n. Each of the next m lines contains two integers i and j, 1 ≤ i, jn.

    Output

    Output n lines contains integer i (number of job in the optimal sequence).

    Sample Input

    2
    4 1
    4 0
    1
    1 2

    Sample Output

    1
    2

    Source

    样例输入

    2
    4 1
    4 0
    1
    1 2

    样例输出

    1
    2

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部