-->
当前位置:首页 > 题库

PROGRAMMING:Job scheduling algorithm -- high response ratio first

Luz5年前 (2021-05-10)题库375
Input n (n > 0) jobs, input the name, arrival time and service time of each job, and calculate the completion time, turnover time and weighted turnover time of each job according to the high response ratio first algorithm (with 2 decimal places reserved).
###Input format:
Enter the number of jobs in the first line, the name of the job in the second line, the arrival time in the third line, and the service time in the fourth line.
###Output format:
The first line outputs the name of the job, the second line outputs the arrival time, the third line outputs the service time, the fourth line outputs the completion time, the fifth line outputs the completion time, and the sixth line outputs the weighted turnover time.
###Input example:
Here is a set of inputs. For example:
```in
five
A B C D E
0 1 2 3 4
4 3 4 2 4
```
###Output example:
The corresponding output is given here. For example:
```out
Assignment Name: a b c d e
Arrival time: 0 1 2 3 4
Service time: 4 3 4 2 4
Completion time: 4 7 13 9 17
Turnaround time: 4 6 11 6 13
Turnover time with rights: 1.00 2.00 2.75 3.00 3.25
```







answer:If there is no answer, please comment