Finally, a convenient way to initialize an std::priority_queue for Dijkstra (G++17 64)

Revision en1, by ollpu, 2021-03-20 21:27:52

Just leaving this here:

auto q = priority_queue(greater(), vector{pair{0ll, 0}});
// or
auto q = priority_queue(greater(), vector{tuple{0ll, 0, 0}});

Only works in GCC 9.1 and up, so you have to submit as GCC C++17 64bit in Codeforces.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English ollpu 2021-03-20 21:27:52 343 Initial revision (published)