aboutsummaryrefslogtreecommitdiff
path: root/Data Structures/sparse_table.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Data Structures/sparse_table.cpp')
-rw-r--r--Data Structures/sparse_table.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Data Structures/sparse_table.cpp b/Data Structures/sparse_table.cpp
index c303930..841674e 100644
--- a/Data Structures/sparse_table.cpp
+++ b/Data Structures/sparse_table.cpp
@@ -8,7 +8,7 @@ public:
for (int i = 0; i <= log(N); i++) st[i].resize(N);
for (int i = 0; i < N; i++) st[0][i] = A[i];
for (int i = 1; i <= log(N); i++) {
- for (int j = 0; j + (1 << i) < N; j++) st[i][j] = min(st[i - 1][j], st[i - 1][j + (1 << (i - 1))]);
+ for (int j = 0; j + (1 << i) <= N; j++) st[i][j] = min(st[i - 1][j], st[i - 1][j + (1 << (i - 1))]);
}
}