fix: infinity

This commit is contained in:
Ayaan Khan 2020-07-17 20:49:00 +05:30
parent 54fd71569f
commit 530da97aec

View File

@ -28,8 +28,9 @@
#include <queue>
#include <utility>
#include <vector>
#include <limits>
constexpr long long INF = 1000000000;
constexpr long long INF = std::numeric_limits<long long>::max();
/**
* @namespace graph
@ -66,7 +67,7 @@ int dijkstra(std::vector<std::vector<std::pair<int, int>>> *adj, int s, int t) {
int n = adj->size();
/// setting all the distances initially to INF
std::vector<int> dist(n, INF);
std::vector<long long> dist(n, INF);
/// creating a min heap using priority queue
/// first element of pair contains the distance