What's wrong with my code?

Revision en1, by dv.jakhar_, 2021-06-30 07:44:02

Hello codeforces, I was solving EXPEDI Spoj problem and my solution is here. Can someone tell me why it's giving me wrong answer. It's working on sample test cases and I think there's some edge case I'm missing. Thanks much :)

My Idea: Firstly I'm sorting all the stops based on their distance from starting point (max from town). Then I'm using a max heap to storing all the possible fuels I can use in the way. While I can't reach the next stop with current fuel I'm using the maximum fuel stored from the max heap (top element). Please take a look at submission link for more understanding.

Tags #help, #wronganswer

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English dv.jakhar_ 2021-06-30 07:44:02 695 Initial revision (published)