diff options
author | Anthony Wang | 2022-04-19 15:13:09 -0500 |
---|---|---|
committer | Anthony Wang | 2022-04-19 15:13:09 -0500 |
commit | 03b09cc02a142e5029f42dc29a93e70588742468 (patch) | |
tree | 87d1c40ad83c09cc2d939d361638870a8251150f /segmenttree.c | |
parent | b95cdd56c2124f7545898e194ee8ad740b161678 (diff) |
Clean up code and fix a typo in segmenttree.c
Diffstat (limited to 'segmenttree.c')
-rw-r--r-- | segmenttree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/segmenttree.c b/segmenttree.c index 4471369..449f8e7 100644 --- a/segmenttree.c +++ b/segmenttree.c @@ -6,7 +6,7 @@ int * seg; void build(sqlite3_stmt *stmt, int l, int r, int n) { if (l == r) { sqlite3_step(stmt); - seg[l] = sqlite3_column_int(stmt, 0); + seg[n] = sqlite3_column_int(stmt, 0); return; } int m = l + r >> 1; @@ -45,4 +45,4 @@ void query(int *res, int v, int l, int r, int n) { else { query(res, v - seg[n << 1], m + 1, r, n << 1 | 1); } -}
\ No newline at end of file +} |