Finding the shortest path with a small twist

Revision en1, by LunaticPriest, 2019-12-16 02:22:15

Hi, the mightly Codeforces community! I'm having some problems with an easy shortest path question. I'm trying to solve Jzzhu and Cities and my code gets a TLE at 45th test case :( I'm basically using Dijkstra's Algo, only with the optimization that I store the information whether a node is reached by a railroad or a normal one. Here is the code. Thanks in advance for all your optimization advice, I'll do my best!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English LunaticPriest 2019-12-16 02:22:15 541 Initial revision (published)