diff options
author | Ta180m | 2019-11-29 15:20:48 -0600 |
---|---|---|
committer | Ta180m | 2019-11-29 15:20:48 -0600 |
commit | a8f2f33be95151f7257baa4994ccdd5c0a2bf08c (patch) | |
tree | 5dcb963fe781a266d0d2de17e8eead077fec4f65 /Data Structures | |
parent | e82dc7de44b56a6c476cfbd88d11c3d7a7bd73da (diff) |
updated segtree
Diffstat (limited to 'Data Structures')
-rw-r--r-- | Data Structures/segment_tree_v2.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Data Structures/segment_tree_v2.cpp b/Data Structures/segment_tree_v2.cpp index 5b3553a..546f6fd 100644 --- a/Data Structures/segment_tree_v2.cpp +++ b/Data Structures/segment_tree_v2.cpp @@ -51,7 +51,7 @@ public: pull(n); } } - void update(int a, int b, T v, int l = 0, int r = -1, int n = 1) { + void update_range(int a, int b, T v, int l = 0, int r = -1, int n = 1) { if (r == -1) r = N - 1; push(l, r, n); if (l > b || r < a) return; @@ -61,7 +61,7 @@ public: } else { int m = (l + r) >> 1; - update(a, b, v, l, m, n << 1), update(a, b, v, m + 1, r, n << 1 | 1); + update_range(a, b, v, l, m, n << 1), update_range(a, b, v, m + 1, r, n << 1 | 1); pull(n); } } |