From d6d3b6183df2e1d40154f406916993f9b15b3cae Mon Sep 17 00:00:00 2001 From: Gloria Mundi Date: Sun, 28 Apr 2024 03:26:45 +0200 Subject: improve sparse tables --- datastructures/sparseTable.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'datastructures/sparseTable.cpp') diff --git a/datastructures/sparseTable.cpp b/datastructures/sparseTable.cpp index 63cce48..64a892a 100644 --- a/datastructures/sparseTable.cpp +++ b/datastructures/sparseTable.cpp @@ -6,9 +6,9 @@ struct SparseTable { return a[lidx] <= a[ridx] ? lidx : ridx; } - void init(vector *vec) { - int n = sz(*vec); - a = vec->data(); + void init(vector &vec) { + int n = sz(vec); + a = vec.data(); st.assign(__lg(n) + 1, vector(n)); iota(all(st[0]), 0); for (int j = 0; (2 << j) <= n; j++) { -- cgit v1.2.3