From 162f7b28db92cec45ad660e7370fd6f81d3d9472 Mon Sep 17 00:00:00 2001 From: Luke Videckis Date: Sat, 4 Apr 2026 12:45:20 -0600 Subject: [PATCH 1/3] testing CI --- library/data_structures_[l,r)/seg_tree_uncommon/max_right.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/data_structures_[l,r)/seg_tree_uncommon/max_right.hpp b/library/data_structures_[l,r)/seg_tree_uncommon/max_right.hpp index 3f615dbb..4ac12cc4 100644 --- a/library/data_structures_[l,r)/seg_tree_uncommon/max_right.hpp +++ b/library/data_structures_[l,r)/seg_tree_uncommon/max_right.hpp @@ -1,4 +1,4 @@ -void max_right(int l, int r, const auto& f) { +void max_right(int l, int r, auto f) { for (T x = unit; l < r;) { int u = l + n, v = __lg(min(u & -u, r - l)), m = l + (1 << v); From e3fd0291e3eca503088949c51db3d21aa446807f Mon Sep 17 00:00:00 2001 From: GitHub Date: Sat, 4 Apr 2026 18:51:46 +0000 Subject: [PATCH 2/3] [auto-verifier] verify commit 162f7b28db92cec45ad660e7370fd6f81d3d9472 --- .verify-helper/timestamps.remote.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index 8e59ca83..8f6a3d6e 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -37,14 +37,14 @@ "tests/library_checker_aizu_tests/data_structures/rmq_linear.test.cpp": "2026-03-09 12:21:26 -0600", "tests/library_checker_aizu_tests/data_structures/rmq_sparse_table.test.cpp": "2026-03-09 12:21:26 -0600", "tests/library_checker_aizu_tests/data_structures/rmq_sparse_table_inc.test.cpp": "2026-01-18 11:15:41 +0000", -"tests/library_checker_aizu_tests/data_structures/simple_tree.test.cpp": "2026-03-25 22:10:17 -0600", +"tests/library_checker_aizu_tests/data_structures/simple_tree.test.cpp": "2026-04-04 12:45:20 -0600", "tests/library_checker_aizu_tests/data_structures/simple_tree_inc.test.cpp": "2026-03-25 22:10:17 -0600", "tests/library_checker_aizu_tests/data_structures/simple_tree_inc_line.test.cpp": "2026-03-25 22:10:17 -0600", "tests/library_checker_aizu_tests/data_structures/simple_tree_inc_queue.test.cpp": "2026-03-25 22:10:17 -0600", "tests/library_checker_aizu_tests/data_structures/simple_tree_inc_walk.test.cpp": "2026-03-25 22:10:17 -0600", -"tests/library_checker_aizu_tests/data_structures/simple_tree_line.test.cpp": "2026-03-25 22:10:17 -0600", -"tests/library_checker_aizu_tests/data_structures/simple_tree_queue.test.cpp": "2026-03-25 22:10:17 -0600", -"tests/library_checker_aizu_tests/data_structures/simple_tree_walk.test.cpp": "2026-03-25 22:10:17 -0600", +"tests/library_checker_aizu_tests/data_structures/simple_tree_line.test.cpp": "2026-04-04 12:45:20 -0600", +"tests/library_checker_aizu_tests/data_structures/simple_tree_queue.test.cpp": "2026-04-04 12:45:20 -0600", +"tests/library_checker_aizu_tests/data_structures/simple_tree_walk.test.cpp": "2026-04-04 12:45:20 -0600", "tests/library_checker_aizu_tests/dsu/dsu.test.cpp": "2026-02-27 15:26:53 -0700", "tests/library_checker_aizu_tests/dsu/dsu_bipartite.test.cpp": "2026-03-06 16:06:56 -0700", "tests/library_checker_aizu_tests/dsu/dsu_weighted_aizu.test.cpp": "2026-03-06 16:06:56 -0700", From 73346b0d9b9d6b926546cdcf04f30d9f2de0247b Mon Sep 17 00:00:00 2001 From: Luke Videckis Date: Mon, 6 Apr 2026 12:05:18 -0600 Subject: [PATCH 3/3] pass lambdas not by const reference --- .../data_structures_[l,r)/bit_uncommon/walk_lambda.hpp | 2 +- .../seg_tree_uncommon/find_first.hpp | 9 ++++----- .../seg_tree_uncommon/find_last.hpp | 7 +++---- .../data_structures_[l,r)/seg_tree_uncommon/min_left.hpp | 2 +- .../data_structures_[l,r]/bit_uncommon/walk_lambda.hpp | 2 +- .../seg_tree_uncommon/max_right.hpp | 2 +- .../data_structures_[l,r]/seg_tree_uncommon/min_left.hpp | 2 +- library/dsu/range_parallel_dsu.hpp | 4 ++-- library/monotonic_stack/monotonic_stack.hpp | 2 +- library/trees/centroid_decomp.hpp | 2 +- library/trees/edge_cd.hpp | 3 +-- 11 files changed, 17 insertions(+), 20 deletions(-) diff --git a/library/data_structures_[l,r)/bit_uncommon/walk_lambda.hpp b/library/data_structures_[l,r)/bit_uncommon/walk_lambda.hpp index a652e94d..fe55e883 100644 --- a/library/data_structures_[l,r)/bit_uncommon/walk_lambda.hpp +++ b/library/data_structures_[l,r)/bit_uncommon/walk_lambda.hpp @@ -1,4 +1,4 @@ -void walk(const auto& f) { +void walk(auto f) { ll sum = 0; for (int i = bit_floor(size(s)), r = 0; i; i /= 2) if (r + i <= sz(s) && f(r + i, sum + s[r + i - 1])) diff --git a/library/data_structures_[l,r)/seg_tree_uncommon/find_first.hpp b/library/data_structures_[l,r)/seg_tree_uncommon/find_first.hpp index dcc78aa2..c960eb34 100644 --- a/library/data_structures_[l,r)/seg_tree_uncommon/find_first.hpp +++ b/library/data_structures_[l,r)/seg_tree_uncommon/find_first.hpp @@ -25,12 +25,11 @@ //! such element exists then `r` is returned //! @time O(log(n)) //! @space O(log(n)) for recursion stack -int find_first(int l, int r, const auto& f) { +int find_first(int l, int r, auto f) { return find_first_in_range(l, r, f, 0, n, 1); } //! invariant: f(tree[v], tl, tr) is 1 -int find_first_in_subtree(const auto& f, int tl, int tr, - int v) { +int find_first_in_subtree(auto f, int tl, int tr, int v) { if (v >= n) return tl; int tm = split(tl, tr); push(tl, tm, tr, v); @@ -38,8 +37,8 @@ int find_first_in_subtree(const auto& f, int tl, int tr, return find_first_in_subtree(f, tl, tm, 2 * v); return find_first_in_subtree(f, tm, tr, 2 * v + 1); } -int find_first_in_range(int l, int r, const auto& f, - int tl, int tr, int v) { +int find_first_in_range(int l, int r, auto f, int tl, + int tr, int v) { if (r <= tl || tr <= l) return r; if (l <= tl && tr <= r) return f(tree[v], tl, tr) diff --git a/library/data_structures_[l,r)/seg_tree_uncommon/find_last.hpp b/library/data_structures_[l,r)/seg_tree_uncommon/find_last.hpp index 74ee92c3..1b90f5b4 100644 --- a/library/data_structures_[l,r)/seg_tree_uncommon/find_last.hpp +++ b/library/data_structures_[l,r)/seg_tree_uncommon/find_last.hpp @@ -25,12 +25,11 @@ //! such element exists then (l - 1) is returned //! @time O(log(n)) //! @space O(log(n)) for recursion stack -int find_last(int l, int r, const auto& f) { +int find_last(int l, int r, auto f) { return find_last_in_range(l, r, f, 0, n, 1); } //! invariant: f(tree[v], tl, tr) is 1 -int find_last_in_subtree(const auto& f, int tl, int tr, - int v) { +int find_last_in_subtree(auto f, int tl, int tr, int v) { if (v >= n) return tl; int tm = split(tl, tr); push(tl, tm, tr, v); @@ -38,7 +37,7 @@ int find_last_in_subtree(const auto& f, int tl, int tr, return find_last_in_subtree(f, tm, tr, 2 * v + 1); return find_last_in_subtree(f, tl, tm, 2 * v); } -int find_last_in_range(int l, int r, const auto& f, int tl, +int find_last_in_range(int l, int r, auto f, int tl, int tr, int v) { if (r <= tl || tr <= l) return l - 1; if (l <= tl && tr <= r) diff --git a/library/data_structures_[l,r)/seg_tree_uncommon/min_left.hpp b/library/data_structures_[l,r)/seg_tree_uncommon/min_left.hpp index 65a71a98..63672114 100644 --- a/library/data_structures_[l,r)/seg_tree_uncommon/min_left.hpp +++ b/library/data_structures_[l,r)/seg_tree_uncommon/min_left.hpp @@ -1,4 +1,4 @@ -void min_left(int l, int r, const auto& f) { +void min_left(int l, int r, auto f) { for (T x = unit; l < r;) { int u = r + n, v = __lg(min(u & -u, r - l)), m = r - (1 << v); diff --git a/library/data_structures_[l,r]/bit_uncommon/walk_lambda.hpp b/library/data_structures_[l,r]/bit_uncommon/walk_lambda.hpp index a87ee4af..1f456b64 100644 --- a/library/data_structures_[l,r]/bit_uncommon/walk_lambda.hpp +++ b/library/data_structures_[l,r]/bit_uncommon/walk_lambda.hpp @@ -1,4 +1,4 @@ -void walk(const auto& f) { +void walk(auto f) { ll sum = 0; for (int i = bit_floor(size(s)), r = 0; i; i /= 2) if (r + i <= sz(s) && f(r + i - 1, sum + s[r + i - 1])) diff --git a/library/data_structures_[l,r]/seg_tree_uncommon/max_right.hpp b/library/data_structures_[l,r]/seg_tree_uncommon/max_right.hpp index 48152e9b..286c19d4 100644 --- a/library/data_structures_[l,r]/seg_tree_uncommon/max_right.hpp +++ b/library/data_structures_[l,r]/seg_tree_uncommon/max_right.hpp @@ -1,4 +1,4 @@ -void max_right(int l, int r, const auto& f) { +void max_right(int l, int r, auto f) { if (T x = s[l + n]; f(l, x)) for (l++; l <= r;) { int u = l + n, v = __lg(min(u & -u, r - l + 1)), diff --git a/library/data_structures_[l,r]/seg_tree_uncommon/min_left.hpp b/library/data_structures_[l,r]/seg_tree_uncommon/min_left.hpp index e86e26c6..d52d401d 100644 --- a/library/data_structures_[l,r]/seg_tree_uncommon/min_left.hpp +++ b/library/data_structures_[l,r]/seg_tree_uncommon/min_left.hpp @@ -1,4 +1,4 @@ -int min_left(int l, int r, const auto& f) { +int min_left(int l, int r, auto f) { if (T x = s[r + n]; f(r, x)) for (r--; l <= r;) { int u = r + 1 + n, v = __lg(min(u & -u, r - l + 1)), diff --git a/library/dsu/range_parallel_dsu.hpp b/library/dsu/range_parallel_dsu.hpp index 03bd3d4f..d18b4e91 100644 --- a/library/dsu/range_parallel_dsu.hpp +++ b/library/dsu/range_parallel_dsu.hpp @@ -8,12 +8,12 @@ struct rp_dsu { vector dsus; rp_dsu(int n): dsus(bit_width(n + 0u), DSU(n)) {} - void join(int u, int v, int len, const auto& f) { + void join(int u, int v, int len, auto f) { int i = __lg(len); join(u, v, f, i); join(u + len - (1 << i), v + len - (1 << i), f, i); } - void join(int u, int v, const auto& f, int i) { + void join(int u, int v, auto f, int i) { if (!dsus[i].join(u, v)) return; if (i == 0) return f(u, v); i--; diff --git a/library/monotonic_stack/monotonic_stack.hpp b/library/monotonic_stack/monotonic_stack.hpp index a133d804..f17529d4 100644 --- a/library/monotonic_stack/monotonic_stack.hpp +++ b/library/monotonic_stack/monotonic_stack.hpp @@ -7,7 +7,7 @@ //! a[le[i]] < a[i] //! @time O(n) //! @space O(n) -vi mono_st(const auto& a, const auto& cmp) { +vi mono_st(const auto& a, auto cmp) { vi l(sz(a)); rep(i, 0, sz(a)) for (l[i] = i - 1; l[i] >= 0 && !cmp(a[l[i]], a[i]);) l[i] = l[l[i]]; diff --git a/library/trees/centroid_decomp.hpp b/library/trees/centroid_decomp.hpp index 572f25e1..4980acb4 100644 --- a/library/trees/centroid_decomp.hpp +++ b/library/trees/centroid_decomp.hpp @@ -5,7 +5,7 @@ //! @endcode //! @time O(n log n) //! @space O(n) -void centroid(auto& adj, const auto& f) { +void centroid(auto& adj, auto f) { vi siz(sz(adj)); auto calc_sz = [&](auto&& self, int u, int p) -> void { siz[u] = 1; diff --git a/library/trees/edge_cd.hpp b/library/trees/edge_cd.hpp index 372309c0..d4038bf6 100644 --- a/library/trees/edge_cd.hpp +++ b/library/trees/edge_cd.hpp @@ -13,8 +13,7 @@ //! handle single-edge-paths separately //! @time O(n logφ n) //! @space O(n) -template -void edge_cd(vector& adj, const auto& f) { +template void edge_cd(vector& adj, auto f) { vi siz(sz(adj)); auto find_cent = [&](auto&& self, int u, int p, int m) -> int {