diff options
Diffstat (limited to 'Data Structures/seg_fenwick_tree.cpp')
-rw-r--r-- | Data Structures/seg_fenwick_tree.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Data Structures/seg_fenwick_tree.cpp b/Data Structures/seg_fenwick_tree.cpp index b3dae30..d0b7066 100644 --- a/Data Structures/seg_fenwick_tree.cpp +++ b/Data Structures/seg_fenwick_tree.cpp @@ -22,7 +22,7 @@ struct node { int m = (l + r) >> 1; return (c[0] ? c[0]->query(a, b, l, m) : 0) + (c[1] ? c[1]->query(a, b, m + 1, r) : 0); } -} FT[MN]; +} FT[MX]; void update(int x, int y, int v) { for (; x < N; x += x & -x) FT[x].update(y, v); } int query(int x, int y1, int y2) { int ret = 0; for (; x > 0; x -= x & -x) ret += FT[x].query(y1, y2); return ret; } |