Google APAC Round B — Travel

Revision en1, by Death_Scythe, 2015-09-20 12:35:48

Hello all! I was trying to solve this problem from the recent APAC contest: https://code.google.com/codejam/contest/10214486/dashboard

I think this problem can be solved by dijkstra's shortest path algorithm. I precompute the minimum time taken from the source for every value of S so that the queries can be answered in constant time.

Here's my code: http://ideone.com/cle94b

I don't see why I am getting a WA.

Any help is appreciated. Thanks!

Tags graph, c++, dijkstra, google code jam

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Death_Scythe 2015-09-20 12:35:48 485 Initial revision (published)