summaryrefslogtreecommitdiff
path: root/test/math/permIndex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/math/permIndex.cpp')
-rw-r--r--test/math/permIndex.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/math/permIndex.cpp b/test/math/permIndex.cpp
index 61d34c8..d68ba3a 100644
--- a/test/math/permIndex.cpp
+++ b/test/math/permIndex.cpp
@@ -1,5 +1,4 @@
#include "../util.h"
-#include <datastructures/pbds.cpp>
#include <math/permIndex.cpp>
void stress_test() {
@@ -7,13 +6,13 @@ void stress_test() {
for (ll i = 0; i < 10'000; i++) {
int n = Random::integer<int>(1, 100);
vector<ll> cur(n);
- iota(all(cur), 0);
+ iota(begin(cur), end(cur), 0);
ll expected = 0;
do {
auto got = permIndex(cur);
if (got != expected) cerr << "got: " << got << ", expected: " << expected << FAIL;
expected++;
- } while (expected < 100 && next_permutation(all(cur)));
+ } while (expected < 100 && ranges::next_permutation(cur).found);
queries += n;
}
cerr << "tested queries: " << queries << endl;
@@ -23,7 +22,7 @@ constexpr int N = 500'000;
void performance_test() {
timer t;
vector<ll> cur(N);
- iota(all(cur), 0);
+ iota(begin(cur), end(cur), 0);
reverse(cur.end() - 10, cur.end());
t.start();
auto hash = permIndex(cur);