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 : http://www.spoj.com/problems/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 : http://ideone.com/mRPwup & http://ideone.com/hB5rQ2