![:D](./images/smilies/icon_biggrin.gif)
![:oops:](./images/smilies/icon_redface.gif)
Moderator: Board moderators
read the problem description carefully.<:3)~~ wrote:Can someone plzz explain me why this question is getting accepted by greedy!!!!
for the given test case the shomaker has to pay a fine of 2 cents.
But if he do the jobs in the order
2 3 1 4
he has to pay 0 cents!!
Code: Select all
indx: 1 2 3 4
time: 3 1 2 5
fine: 4 1000 2 5
Code: Select all
8
10
1 1
1 1
1 1
1 1
2 2
3 3
2 2
2 2
4 4
3 3
5
10 10
10 10
10 10
10 11
10 10
5
1 1
1 1
1 1
1 1
1 1
6
1 1
2 2
3 3
4 4
5 5
6 6
10
1 1
1 2
2 2
2 4
3 3
3 9
4 4
4 16
5 5
5 25
10
1 1
1 2
2 2
2 3
3 3
3 4
4 4
4 5
5 5
5 6
10
1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
5 1
5 2
20
200 10
190 10
190 9
200 11
199 10
199 11
200 11
200 9
201 9
201 10
201 11
191 9
10000 9999
9999 10000
10000 10000
9999 9999
5 10000
10000 5
5 5
Code: Select all
1 2 3 4 5 6 7 8 9 10
4 1 2 3 5
1 2 3 4 5
1 2 3 4 5 6
10 8 6 2 4 1 3 5 7 9
2 4 6 8 10 1 3 5 7 9
2 1 4 6 3 8 10 5 7 9
17 14 15 16 19 13 6 4 7 11 2 5 1 10 3 12 8 9 18 20
Code: Select all
...
Code: Select all
1
5
8 9
11 9
12 19
8 9
12 19
Code: Select all
3 5 1 4 2^