Rating changes for the last round are temporarily rolled back. They will be returned soon. ×

Need help to calculate the complexity of solution for D. Abandoning Roads using a normal queue.

Revision en2, by _Muhammad, 2019-05-19 23:08:38

For 1149D - Отказ от дорог I implemented this code using a priority queue. This is tutorials logic. And took 639ms.

But when I implemented same logic using a single normal queue it took 280ms. ( My code ).

Can any one tell me why without priority queue Dijkstra working much faster. Please help me to understand the complexity for 2nd code ( without priority queue ) . I understood the complexity of the 1st code ( with priority queue ).

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English _Muhammad 2019-05-19 23:08:38 20 Tiny change: 'I implemen' -> 'For [problem:1149D] I implemen'
en1 English _Muhammad 2019-05-19 21:31:11 630 Initial revision (published)