Asking about counting the number of shortest paths algorithm

Revision en5, by ldn694, 2020-12-23 20:34:35

Hello Codeforces. I have just recently joined a contest at my school. In that contest, there was a problem requiring counting the number of shortest paths from a vertex s to every other vertex in a directed weighted graph. I have implemented my idea and tested it a bit so I had a strong belief that my code was correct. In the end, it turned out that the code was wrong. The contest gave me only one submission for each problem so I didn't have a chance to fix it during the contest. I have tried to find my mistakes in the code at home but I found nothing. Here is the code similar to what I submitted during the contest.

The code

Can anyone help me point out the mistake in the algorithm or maybe this was not the incorrect part in my initial code? I would be so grateful if you can provide a link to another problem that also requires counting the number of shortest paths so that I can test the code by myself. Thanks for reading and have a good day.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English ldn694 2020-12-23 20:34:35 14
en4 English ldn694 2020-12-23 20:23:24 0 (published)
en3 English ldn694 2020-12-23 20:22:02 65
en2 English ldn694 2020-12-23 20:18:29 334
en1 English ldn694 2020-12-23 20:12:09 1619 Initial revision (saved to drafts)