Skip to content

Commit

Permalink
Fixed sparseTable.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
dothething1DA committed Nov 20, 2024
1 parent 807335a commit 493c384
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/data-structures/sparseTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct SparseTable {
for (int i = 1; i <= n; i += 1) st[0][i] = a[i];

for (int i = 1; i < lg2; i += 1)
for (int j = 1; j <= n; j += 1)
for (int j = 1; j + (1 << (i-1)) <= n; j += 1)
// CAREFUL MIN-MAX
st[i][j] = min(st[i-1][j], st[i-1][j + (1 << (i-1))]);
}
Expand Down
Binary file modified kactl.pdf
Binary file not shown.

0 comments on commit 493c384

Please sign in to comment.