diff options
Diffstat (limited to 'datastructures/fenwickTree.cpp')
| -rw-r--r-- | datastructures/fenwickTree.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/datastructures/fenwickTree.cpp b/datastructures/fenwickTree.cpp deleted file mode 100644 index 7013613..0000000 --- a/datastructures/fenwickTree.cpp +++ /dev/null @@ -1,15 +0,0 @@ -vector<ll> tree; - -void update(int i, ll val) { - for (i++; i < ssize(tree); i += i & -i) tree[i] += val; -} - -void init(int n) { - tree.assign(n + 1, 0); -} - -ll prefix_sum(int i) { - ll sum = 0; - for (; i > 0; i &= i-1) sum += tree[i]; - return sum; -} |
