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

Show all messages Hide all messages

How to solve this problem in O(n^2) Anton juver++ Postnikov 13 Aug 2006 01:21
Give me some hints please
you can use dynamic programming
Re: How to solve this problem in O(n^2) Anton juver++ Postnikov 14 Aug 2006 00:46
Please, tell me how to dp?
I just use a heap.

Edited by author 18.08.2006 19:22
Hint 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