Whenever using std::priority_queue, we were not setting the comparator, assuming that it would use std::less by default (which it does). However, by using std::less, it sorts in decreasing order (and not increasing order, which was expected). Thus, we changed them all to std::greater, fixing the issue.
Whenever using
std::priority_queue
, we were not setting the comparator, assuming that it would usestd::less
by default (which it does). However, by usingstd::less
, it sorts in decreasing order (and not increasing order, which was expected). Thus, we changed them all tostd::greater
, fixing the issue.