summaryrefslogtreecommitdiff
path: root/datastructures/test/fenwickTree2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'datastructures/test/fenwickTree2.cpp')
-rw-r--r--datastructures/test/fenwickTree2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/datastructures/test/fenwickTree2.cpp b/datastructures/test/fenwickTree2.cpp
index 359a5c4..18ebcb7 100644
--- a/datastructures/test/fenwickTree2.cpp
+++ b/datastructures/test/fenwickTree2.cpp
@@ -12,10 +12,10 @@ void test(int n) {
update(l, r, delta);
for (int i = l; i < r; i++) naive[i] += delta;
- r = util::randint(n+1) - 1;
+ r = util::randint(n+1);
ll naive_result = 0;
- for (int i = 0; i <= r; i++) naive_result += naive[i];
+ for (int i = 0; i < r; i++) naive_result += naive[i];
ll fenwick_result = prefix_sum(r);
assert(naive_result == fenwick_result);
}