From 4d9f88f0d7cfe7f6a1b5664857949e38f25ffa76 Mon Sep 17 00:00:00 2001 From: Shivam Singh Rajput Date: Tue, 9 Oct 2018 21:40:56 +0530 Subject: [PATCH] Updated Weights --- FloydWarshall.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FloydWarshall.cpp b/FloydWarshall.cpp index ef2c9b3..d4cf127 100644 --- a/FloydWarshall.cpp +++ b/FloydWarshall.cpp @@ -15,7 +15,7 @@ class FloydWarshall vector > W; int SIZE; public: - FloydWarshall(int N = 0) :W(N, vector(N, 1e9)), SIZE(N) + FloydWarshall(int N = 0) :W(N, vector(N, 1e18)), SIZE(N) { for (int i = 0; i < SIZE; i++) W[i][i] = 0; @@ -37,7 +37,7 @@ class FloydWarshall { if (i != Source) { - if (W[Source][i] == 1e9) + if (W[Source][i]>5e17) printf("-1 "); else printf("%lld ", W[Source][i]);