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

Правка en1, от 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.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ollpu 2021-03-20 21:27:52 343 Initial revision (published)