From 4faf0483a66578774d95830695f665169469d96f Mon Sep 17 00:00:00 2001 From: Paul Jungeblut Date: Thu, 6 Oct 2016 19:05:28 +0200 Subject: Replacing magic number in segtree by constant. --- datastructures/segmentTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datastructures/segmentTree.cpp b/datastructures/segmentTree.cpp index c67cd8b..3905151 100644 --- a/datastructures/segmentTree.cpp +++ b/datastructures/segmentTree.cpp @@ -4,7 +4,7 @@ int a[MAX_N], m[4 * MAX_N]; int query(int x, int y, int k = 0, int X = 0, int Y = MAX_N - 1) { if (x <= X && Y <= y) return m[k]; - if (y < X || Y < x) return -1000000000; // Ein "neutrales" Element. + if (y < X || Y < x) return -INF; // Ein "neutrales" Element. int M = (X + Y) / 2; return max(query(x, y, 2*k+1, X, M), query(x, y, 2*k+2, M+1, Y)); } -- cgit v1.2.3