diff options
| author | Gloria Mundi <gloria@gloria-mundi.eu> | 2025-02-19 21:29:03 +0100 |
|---|---|---|
| committer | Gloria Mundi <gloria@gloria-mundi.eu> | 2025-02-19 21:29:03 +0100 |
| commit | 0f1223c5396961a661da4f12caf0252f924de01b (patch) | |
| tree | c3828c5ed20d36bf950808ec26502aee8d08ea83 /test | |
| parent | 30fb502038c560ffa10418153887b536011306ab (diff) | |
reverse dynamic convex hull
Diffstat (limited to 'test')
| -rw-r--r-- | test/datastructures/dynamicConvexHull.cpp | 4 | ||||
| -rw-r--r-- | test/datastructures/dynamicConvexHull.lichao.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/datastructures/dynamicConvexHull.cpp b/test/datastructures/dynamicConvexHull.cpp index e0345af..02e50f4 100644 --- a/test/datastructures/dynamicConvexHull.cpp +++ b/test/datastructures/dynamicConvexHull.cpp @@ -29,7 +29,7 @@ void stress_test(ll range) { ll got = hd.query(x); ll expected = naive[0](x); - for (auto l : naive) expected = max(expected, l(x)); + for (auto l : naive) expected = min(expected, l(x)); if (got != expected) cerr << "got: " << got << ", expected: " << expected << FAIL; queries++; @@ -49,7 +49,7 @@ void performance_test() { ll m = Random::integer<ll>(-1'000'000'000, 1'000'000'000); ll c = Random::integer<ll>(-1'000'000'000, 1'000'000'000); ll x = Random::integer<ll>(-1'000'000'000, 1'000'000'000); - + t.start(); hd.add(m, c); hash += hd.query(x); diff --git a/test/datastructures/dynamicConvexHull.lichao.cpp b/test/datastructures/dynamicConvexHull.lichao.cpp index 9a6ffb9..f692e92 100644 --- a/test/datastructures/dynamicConvexHull.lichao.cpp +++ b/test/datastructures/dynamicConvexHull.lichao.cpp @@ -16,11 +16,11 @@ void stress_test(ll range) { ll m = Random::integer<ll>(-range, range); ll c = Random::integer<ll>(-range, range); hd.add(m, c); - lichao.insert({-m, -c}); + lichao.insert({m, c}); for (ll x : xs) { ll gotA = hd.query(x); - ll gotB = -lichao.query(x); + ll gotB = lichao.query(x); if (gotA != gotB) cerr << "gotA: " << gotA << ", gotB: " << gotB << FAIL; queries++; |
