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

PROGRAMMING:Optimal scheduling problem

Luz5年前 (2021-05-10)题库353
Suppose that n (n < = 20) tasks are performed by K (k < = 20) parallel machines. The time required to complete task I is ti. Try to design an algorithm, for any given integer n and K, and the time required to complete task I is Ti, I = 1 ~ n. Calculate the best schedule to complete the n tasks, so that the time to complete all tasks is the earliest.
###Input format:
The first line of input data has two positive integers n and K. The n positive integers in line 2 are the time required to complete n tasks.
###Output format:
Output the calculated earliest time to complete all tasks to the screen.
###Input example:
Here is a set of inputs. For example:
```in
7 3
2 14 4 16 6 5 3
```
###Output example:
The corresponding output is given here. For example:
```out
seventeen
```







answer:If there is no answer, please comment