aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2020-08-16 20:56:31 -0500
committerAnthony Wang2020-08-16 20:56:31 -0500
commit26012998c7bf5bfa6cf34b477dc093cc7987156c (patch)
tree0db17100b500caf95acd56a2351f7e18c523ab98
parent6ecb2c72d6a5afde259cf8252b77ed1da742527b (diff)
Update segment_tree.cpp
-rw-r--r--Data Structures/segment_tree.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Data Structures/segment_tree.cpp b/Data Structures/segment_tree.cpp
index dfe0b5d..942a8fe 100644
--- a/Data Structures/segment_tree.cpp
+++ b/Data Structures/segment_tree.cpp
@@ -1,4 +1,4 @@
-int seg[400004], tmp[400004];
+int seg[4*MAXN], tmp[4*MAXN];
inline int pull(const int & a, const int & b) { return a + b; }
inline void push(int l, int r, int n) {
seg[n] += (r - l + 1) * tmp[n];
@@ -35,4 +35,4 @@ int query(int a, int b, int l = 0, int r = -1, int n = 1) {
if (l >= a && r <= b) return seg[n];
int m = (l + r) >> 1;
return pull(query(a, b, l, m, n << 1), query(a, b, m + 1, r, n << 1 | 1));
-} \ No newline at end of file
+}