diff options
author | Ta180m | 2020-01-06 18:38:57 -0600 |
---|---|---|
committer | Ta180m | 2020-01-06 18:38:57 -0600 |
commit | fbe807c036a4801e679087906c6cbe88204c471e (patch) | |
tree | 4a43c207c1b59082bc0b229f1ec7317b56c049bd /Data Structures | |
parent | c0347786158dfd1808c16e8616f95a2a0714c5bb (diff) |
Update segment_tree_v2.cpp
Diffstat (limited to 'Data Structures')
-rw-r--r-- | Data Structures/segment_tree_v2.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Data Structures/segment_tree_v2.cpp b/Data Structures/segment_tree_v2.cpp index 546f6fd..9c10532 100644 --- a/Data Structures/segment_tree_v2.cpp +++ b/Data Structures/segment_tree_v2.cpp @@ -67,7 +67,7 @@ public: } T query(int a, int b, int l = 0, int r = -1, int n = 1) { if (r == -1) r = N - 1; - if (l > b || r < a) return 0; + if (a > b || l > b || r < a) return 0; push(l, r, n); if (l >= a && r <= b) return seg[n]; int m = (l + r) >> 1; |