aboutsummaryrefslogtreecommitdiff
path: root/Data Structures
diff options
context:
space:
mode:
authorTa180m2020-04-07 19:32:48 -0500
committerTa180m2020-04-07 19:32:48 -0500
commit174f6421541ab2b0443543dfb4df533f48c2943d (patch)
tree60817e4e32750a6f76e4194fc02f9d127d293398 /Data Structures
parent89ad75285f051fc143f45b6d841792d4021cc03c (diff)
bugfix
Diffstat (limited to 'Data Structures')
-rw-r--r--Data Structures/segment_tree_v2.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Data Structures/segment_tree_v2.cpp b/Data Structures/segment_tree_v2.cpp
index 0fc15ba..f6e9e1d 100644
--- a/Data Structures/segment_tree_v2.cpp
+++ b/Data Structures/segment_tree_v2.cpp
@@ -19,7 +19,7 @@ public:
}
void pull(int n) { seg[n] = seg[n << 1] + seg[n << 1 | 1]; }
void push(int l, int r, int n) {
- seg[n] = (r - l + 1) * tmp[n];
+ seg[n] += (r - l + 1) * tmp[n];
if (l != r) tmp[n << 1] += tmp[n], tmp[n << 1 | 1] += tmp[n];
tmp[n] = 0;
}