From b890783bf60c344e6c2932be204c16c72ce1a927 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Tue, 19 Apr 2022 15:21:14 -0500 Subject: Fix another segtree bug --- segmenttree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2