aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2022-04-19 15:21:14 -0500
committerAnthony Wang2022-04-19 15:21:14 -0500
commitb890783bf60c344e6c2932be204c16c72ce1a927 (patch)
tree8b7e452dad83ce4c3680f19cd9c4dc89180326a7
parent03b09cc02a142e5029f42dc29a93e70588742468 (diff)
Fix another segtree bug
-rw-r--r--segmenttree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/segmenttree.c b/segmenttree.c
index 449f8e7..418c78e 100644
--- a/segmenttree.c
+++ b/segmenttree.c
@@ -18,7 +18,7 @@ void build(sqlite3_stmt *stmt, int l, int r, int n) {
/* Update value at index x*/
void update(int x, int v, int l, int r, int n) {
if (l == r) {
- seg[n] += v;
+ seg[n] = v;
return;
}
int m = l + r >> 1;