I used priority_queue<unsigned int>, but still got MLE. Help me !!

Posted by

Cabbage 16 Sep 2015 16:42

Here is my code. I used the technics as described by others, but it still won't work.

//Code deleted.

*Edited by author 17.09.2015 12:29*

Re: I used priority_queue<unsigned int>, but still got MLE. Help me !!

Posted by

Cabbage 17 Sep 2015 12:31

OK, I get that by myself. I've deleted the code I put here before. I implemented a binary heap by myself, and used it to pass the problem. It worked.

Re: I used priority_queue<unsigned int>, but still got MLE. Help me !!

Cabbage,can you give me your code?I can't solve this MLE problem.:(.My email is xuantungptit@gmail.com

Re: I used priority_queue<unsigned int>, but still got MLE. Help me !!

I got MLE too! But then I used vector and got AC.

Instead of priority_queue try to use vector and algorithms: make_heap, push_heap, pop_heap, sort_heap. In some topic here I saw detailed information on this solution which helped me to get AC.