So I was reading this analysis, and when I understand most of it, I couldn’t figure out the purpose of this piece of code:
int d = -q.top().first; . . q.push(make_pair(-D[nr][nc], nr * N + nc));
What is the purpose of the double negative? On removing the negatives, the code results in a TLE on some of the test-cases.