|
|
back to boardIf you keep on getting MLE 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. |
|
|