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

Правка en2, от _Muhammad, 2019-05-19 23:08:38

For 1149D - Abandoning Roads 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 ).

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский _Muhammad 2019-05-19 23:08:38 20 Tiny change: 'I implemen' -> 'For [problem:1149D] I implemen'
en1 Английский _Muhammad 2019-05-19 21:31:11 630 Initial revision (published)