summaryrefslogtreecommitdiff
path: root/test/datastructures/monotonicConvexHull.cpp
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
commit1880ccb6d85c6eb79e724593457877bab431951c (patch)
tree23eddd5bd0b29b3024e170a5ef9023eda9226ab5 /test/datastructures/monotonicConvexHull.cpp
parente95f59debd69ee7d45d5c966ce466d23264e1c3c (diff)
get rid of all() and sz()
Diffstat (limited to 'test/datastructures/monotonicConvexHull.cpp')
-rw-r--r--test/datastructures/monotonicConvexHull.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/datastructures/monotonicConvexHull.cpp b/test/datastructures/monotonicConvexHull.cpp
index 3ae7c4d..98d74f8 100644
--- a/test/datastructures/monotonicConvexHull.cpp
+++ b/test/datastructures/monotonicConvexHull.cpp
@@ -12,12 +12,12 @@ void stress_test(ll range) {
for (int tries = 0; tries < 1000; tries++) {
int n = Random::integer<int>(1, 100);
auto ms = Random::integers<ll>(n, -range, range);
- sort(all(ms), greater<>{});
+ ranges::sort(ms | views::reverse);
auto cs = ms;
for (int l = 0, r = 0; l < n;) {
while (r < n && ms[l] == ms[r]) r++;
auto tmp = Random::distinct<ll>(r - l, -range, range);
- sort(all(tmp), greater<>{});
+ ranges::sort(tmp | views::reverse);
for (int c : tmp) {
cs[l] = c;
l++;
@@ -25,7 +25,7 @@ void stress_test(ll range) {
}
auto xs = Random::integers<ll>(n*100, -range*n, range*n);
- sort(all(xs));
+ ranges::sort(xs);
int i = 0;
vector<Line> naive;
@@ -58,12 +58,12 @@ void stress_test_independent(ll range) {
for (int tries = 0; tries < 1000; tries++) {
int n = Random::integer<int>(1, 100);
auto ms = Random::integers<ll>(n, -range, range);
- sort(all(ms), greater<>{});
+ ranges::sort(ms | views::reverse);
auto cs = ms;
for (int l = 0, r = 0; l < n;) {
while (r < n && ms[l] == ms[r]) r++;
auto tmp = Random::distinct<ll>(r - l, -range, range);
- sort(all(tmp), greater<>{});
+ ranges::sort(tmp | views::reverse);
for (int c : tmp) {
cs[l] = c;
l++;
@@ -81,7 +81,7 @@ void stress_test_independent(ll range) {
naive.emplace_back(m, c);
auto xs = Random::integers<ll>(100, -range, range);
- sort(all(xs));
+ ranges::sort(xs);
auto tmp = mch;
for (auto x : xs) {
@@ -101,9 +101,9 @@ constexpr int N = 1'000'000;
void performance_test() {
timer t;
auto ms = Random::distinct<ll>(N, -1'000'000'000, 1'000'000'000);
- sort(all(ms), greater<>{});
+ ranges::sort(ms | views::reverse);
auto xs = Random::distinct<ll>(N, -1'000'000'000, 1'000'000'000);
- sort(all(xs));
+ ranges::sort(xs);
Envelope mch;
hash_t hash = 0;