Implementation problem of the Dijkstra Algorithm

Revision en1, by roycf123, 2023-07-24 10:01:56

Recently, I was solving the Graphs section of the CSES problemset and encountered this problem. I used dijkstra algorithm to solve it.

I generally use the template from here, but in this question, this implementation gave me WA. When I used another implementation using visited array, it gave AC.

WA code
Tags graphs, dijkstras validity, dijkstra

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English roycf123 2023-07-24 10:10:22 3435 (published)
en1 English roycf123 2023-07-24 10:01:56 2034 Initial revision (saved to drafts)