dv.jakhar_'s blog

By dv.jakhar_, history, 3 years ago, In English

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.

  • Vote: I like it
  • -1
  • Vote: I do not like it