WA in TSHPATH from SPOJ

Ive implemented a really simple Dijsktra using STL priority queues
Im getting a WA and I can figure out why. Help me guys!
CODE LINK : http://ideone.com/AMFY75
QUESTION LINK : SPOJ.com - Problem TSHPATH

  1. Use fast i/o.
  2. Set INF to a higher value as distance can reach upto 10000*200000.
  3. Reset the d array to INF after finding each path.

Brother, implemented in two ways : mRPwup - Online C++ Compiler & Debugging Tool - Ideone.com & hB5rQ2 - Online C++ Compiler & Debugging Tool - Ideone.com

3 Likes