ChrisVilches / Algorithms

Solutions for competitive programming problems in various online judges such as Kattis, SPOJ, URI Online Judge, etc.
5 stars 0 forks source link

In kattis/shortestpath1 the comparator can be removed #1

Closed ChrisVilches closed 3 years ago

ChrisVilches commented 3 years ago

Just use pair<int, int> without any extra information, and it should work properly.

However, this problem only has two test cases, so it's not very reliable.

ChrisVilches commented 3 years ago

A new problem using a more compact Dijkstra has been added, so use that one in the future:

https://github.com/ChrisVilches/Algorithms/blob/main/uva/13010-galactic_taxes.cpp

ChrisVilches commented 3 years ago

NOTE: A user-provided Compare can be supplied to change the ordering, e.g. using std::greater would cause the smallest element to appear as the top().

https://en.cppreference.com/w/cpp/container/priority_queue

This is what I did there ↑