diff options
author | Ta180m | 2020-04-07 19:32:48 -0500 |
---|---|---|
committer | Ta180m | 2020-04-07 19:32:48 -0500 |
commit | 174f6421541ab2b0443543dfb4df533f48c2943d (patch) | |
tree | 60817e4e32750a6f76e4194fc02f9d127d293398 /Data Structures | |
parent | 89ad75285f051fc143f45b6d841792d4021cc03c (diff) |
bugfix
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 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; } |