diff options
Diffstat (limited to 'test/datastructures/sparseTable.cpp')
| -rw-r--r-- | test/datastructures/sparseTable.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/datastructures/sparseTable.cpp b/test/datastructures/sparseTable.cpp index 9a7fac5..078f336 100644 --- a/test/datastructures/sparseTable.cpp +++ b/test/datastructures/sparseTable.cpp @@ -8,13 +8,13 @@ void stress_test() { int n = Random::integer<int>(1, 100); vector<ll> naive = Random::integers<ll>(n, -1000, 1000); SparseTable st; - st.init(&naive); + st.init(naive); for (int operations = 0; operations < 1000; operations++) { queries++; int l = Random::integer<int>(0, n+1); int r = Random::integer<int>(0, n+1); - ll got = st.queryIdempotent(l, r); + ll got = st.query(l, r); ll expected = r <= l ? -1 : l; for (int j = l; j < r; j++) { if (naive[j] < naive[expected]) expected = j; @@ -31,14 +31,14 @@ void performance_test() { vector<ll> naive = Random::integers<ll>(N, -1000, 1000); t.start(); SparseTable st; - st.init(&naive); + st.init(naive); t.stop(); hash_t hash = 0; for (int operations = 0; operations < N; operations++) { auto [l, r] = Random::pair<int>(0, N+1); - + t.start(); - hash += st.queryIdempotent(l, r); + hash += st.query(l, r); t.stop(); } if (t.time > 500) cerr << "too slow: " << t.time << FAIL; |
