aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2021-01-19 21:44:08 -0600
committerAnthony Wang2021-01-19 21:44:08 -0600
commit6087e1adebc9025681c0efbaa59d530472af0d2f (patch)
tree0cf781b134b211452bb83eab937c40f9af01e365
parent8512013002ee2544384e571ad413a96925b266b6 (diff)
Update fenwick_tree.cpp
-rw-r--r--Data Structures/fenwick_tree.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Data Structures/fenwick_tree.cpp b/Data Structures/fenwick_tree.cpp
index 4f73507..0ffeb3e 100644
--- a/Data Structures/fenwick_tree.cpp
+++ b/Data Structures/fenwick_tree.cpp
@@ -1,7 +1,7 @@
template<typename T> class fenwick_tree {
private: int N; T FT[MX];
public:
- fenwick_tree(int n) { N = n }
+ fenwick_tree(int n) { N = n; }
fenwick_tree(int n, T A[]) { N = n; memcpy(FT, A, sizeof FT); }
void update(int x, T val) { if (++x) for (; x < N; x += x&-x) FT[x] += val; }
T query(int x) { T ret = 0; if (++x) for (; x; x -= x&-x) ret += FT[x]; return ret; }