ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1403. Courier

How to solve this problem in O(n^2)
Posted by Anton [SUrSU] 13 Aug 2006 01:21
Give me some hints please
Re: How to solve this problem in O(n^2)
Posted by azadeh 13 Aug 2006 01:32
you can use dynamic programming
Re: How to solve this problem in O(n^2)
Posted by Anton [SUrSU] 14 Aug 2006 00:46
Please, tell me how to dp?
You can solve this program in O(n*log n),
Posted by TheBeet 18 Aug 2006 19:22
I just use a heap.

Edited by author 18.08.2006 19:22
Hint
Posted by ASK 10 Mar 2010 16:23
Sort by finish time. For every delivery do: if current delivery time is greater than the number of already scheduled deliveries, schedule it; else (that is, it is equal), replace the least important scheduled delivery with this one. Altogether O(n log(n)).

Edited by author 10.03.2010 18:40

Edited by author 10.03.2010 18:40