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 1306. Sequence Median

If you keep on getting MLE
Posted by Olzhas2dy 29 Jun 2007 02:22
This one is a really tough one. Even though solving it was kind of fun, I really got tired of it. I used a heap. I also tried priority_queue<T> template, but for some reason I was just keep on getting MLE on the test #7. I really don't know how other people made a good use of priority_queue<T>. My advise is simple - just use binary heap with "add to a heap" and "delete from a heap" operations. If you don't know what it is visit this site "http://en.wikipedia.org/wiki/Binary_heap"(I would pay attention to the part where the author describes an array implementation of it). Good luck.