In the event of technical difficulties with Szkopuł, please contact us via email at szkopul@fri.edu.pl.
If you would like to talk about tasks, solutions or technical problems, please visit our Discord servers. They are moderated by the community, but members of the support team are also active there.
We are given independent and indivisible jobs numbered from
to
. They should be executed sequentially in any order.
The later the execution of a job starts the longer it lasts - precisely, the
time of execution of the job
is
, if we start it in the moment
. We assume that
,
.
The goal is to schedule the jobs so that the total execution time is the shortest.
Write a program that:
One should write in the standard output the scheduling of the jobs, i.e. an
appropriate permutation of numbers ; one number per
line.
For the input data:
5 0.002000 0.003000 0.016000 0.001000 0.100000 0.300000 0.016000 0.005000 0.030000 0.060000
the correct result is:
2 4 1 5 3
Task author: Marcin Jurdzinski.