From 9e9d3410c7e15df3dcb871b8efbac1f6fa68feac Mon Sep 17 00:00:00 2001 From: Luke Videckis Date: Sat, 14 Feb 2026 20:34:20 -0700 Subject: [PATCH 1/4] another idea --- .../seg_tree_uncommon/walk.hpp | 14 ++++++++------ .../data_structures/simple_tree_inc_walk.test.cpp | 10 ++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/library/data_structures_[l,r]/seg_tree_uncommon/walk.hpp b/library/data_structures_[l,r]/seg_tree_uncommon/walk.hpp index 7cf9e801..8ac6a6ca 100644 --- a/library/data_structures_[l,r]/seg_tree_uncommon/walk.hpp +++ b/library/data_structures_[l,r]/seg_tree_uncommon/walk.hpp @@ -1,8 +1,10 @@ int walk(int l, int r, const auto& f) { - while (l <= r) { - int u = l + n, v = __lg(min(u & -u, r - l + 1)); - if (f(s[u >> v])) l += 1 << v; - else r = l + (1 << v) - 2; - } - return l; + l += n, r += n; + if (T x = s[l]; f(x)) + for (l++; l <= r;) { + int v = __lg(min(l & -l, r - l + 1)); + if (T y = op(x, s[l >> v]); f(y)) l += 1 << v, x = y; + else r = l + (1 << v) - 2; + } + return l - n; } diff --git a/tests/library_checker_aizu_tests/data_structures/simple_tree_inc_walk.test.cpp b/tests/library_checker_aizu_tests/data_structures/simple_tree_inc_walk.test.cpp index 50c2ea3f..386a7f30 100644 --- a/tests/library_checker_aizu_tests/data_structures/simple_tree_inc_walk.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/simple_tree_inc_walk.test.cpp @@ -1,6 +1,9 @@ #define PROBLEM \ "https://judge.yosupo.jp/problem/predecessor_problem" #include "../template.hpp" +int __lg(unsigned x) { + return bit_width(x) - 1; +} #include "../../../library/data_structures_[l,r]/seg_tree.hpp" int main() { cin.tie(0)->sync_with_stdio(0); @@ -32,13 +35,8 @@ int main() { if (total == 0) { cout << -1 << '\n'; } else { - int pref_sum = 0; cout << st.walk(0, k, [&](int sum) { - if (pref_sum + sum < total) { - pref_sum += sum; - return 1; - } - return 0; + return sum < total; }) << '\n'; } } From ac29c690cbed8968b977e7baafa39a188261f7f7 Mon Sep 17 00:00:00 2001 From: GitHub Date: Sun, 15 Feb 2026 05:50:02 +0000 Subject: [PATCH 2/4] [auto-verifier] verify commit 9e9d3410c7e15df3dcb871b8efbac1f6fa68feac --- .verify-helper/timestamps.remote.json | 286 +++++++++++++------------- 1 file changed, 143 insertions(+), 143 deletions(-) diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index 98670f4b..b88bbd4a 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -1,145 +1,145 @@ { -"tests/library_checker_aizu_tests/convolution/gcd_convolution.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/convolution/lcm_convolution.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/convolution/min_plus_convolution.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/binary_search_example.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/binary_trie.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/bit.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/bit_inc.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/bit_rupq.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/bit_rurq.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/bit_walk.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/deque.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/deque_index.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/deque_op.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/deque_sliding_window.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/disjoint_rmq_inc.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/disjoint_rmq_inc_lines.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/disjoint_rmq_inc_sum.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/distinct_query.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/dsu.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/dsu_bipartite.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/dsu_restorable.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/dsu_segtree_undo_trick.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/implicit_seg_tree.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/kruskal_tree_aizu.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/kth_smallest_wavelet_matrix.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/lazy_segment_tree.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/lazy_segment_tree_constructor.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/lazy_segment_tree_inc.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/lazy_segment_tree_inc_constructor.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/line_tree_aizu.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/line_tree_lib_checker.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/merge_sort_tree.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/permutation_tree.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/persistent_queue_tree.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/persistent_seg_tree.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/pq_ds_undo_sliding_window.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/pq_ds_undo_with_dsu.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/range_parallel_dsu.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/rmq_linear.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/rmq_sparse_table.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/rmq_sparse_table_inc.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/simple_tree.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/simple_tree_inc.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/simple_tree_inc_line.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/simple_tree_inc_walk.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/simple_tree_line.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/data_structures/simple_tree_walk.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/flow/dinic_aizu.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/flow/hungarian.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/flow/min_cost_max_flow.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/dijkstra_aizu.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/dijkstra_lib_checker.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/directed_cycle.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/enumerate_triangles.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/hopcroft_karp_aizu.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/hopcroft_karp_lib_checker.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/mst.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/graphs/two_edge_components.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/count_paths.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/dsu.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/dsu_size.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/edge_cd_small_trees.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/fib_matrix_expo.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/hilbert_mos.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/manacher.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/merge_st_and_wavelet.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/mobius.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/mod_division.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/n_choose_k.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/permutation_tree_small.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/rmq_small_n.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/sa_find_subarray.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/seg_tree_find.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/handmade_tests/seg_tree_find_small.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/loops/chooses.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/loops/quotients.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/loops/submasks.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/loops/supermasks.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/binary_matrix_mult.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/count_paths.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/derangement.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/matrix_determinant.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/matrix_mult.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/n_choose_k.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/num_subsequences.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/partitions.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/prime_sieve.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/solve_linear_mod.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/tetration.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/totient.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/math/xor_basis_intersection.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/monotonic_stack_related/cartesian_binary_tree.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/monotonic_stack_related/cartesian_k_ary_tree.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/monotonic_stack_related/count_rectangles.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/monotonic_stack_related/max_rect_histogram.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/kmp.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/lcp_array.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/lcp_query_palindrome.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/lcp_query_zfunc.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/lcs_dp.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/lcs_queries.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/lcs_queries_merge_sort_tree.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/manacher.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/multi_matching_bs.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/prefix_function.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/sa_cmp.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/suffix_array.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/suffix_array_short.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/trie.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/strings/wildcard_pattern_matching.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/count_paths_per_length.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/edge_cd_contour_range_query.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/edge_cd_contour_range_update.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/edge_cd_count_paths_per_length.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/edge_cd_reroot_dp.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/hld_aizu1.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/hld_aizu2.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/hld_lib_checker_path.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/hld_lib_checker_subtree_edges.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/hld_lib_checker_subtree_nodes.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/kth_path_ladder.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/kth_path_linear.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/kth_path_tree_lift.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/lca_all_methods_aizu.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/lca_all_methods_lib_checker.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/shallowest_aizu_tree_height.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/shallowest_lib_checker_tree_path_composite.test.cpp": "2026-02-14 20:58:21 +0000", -"tests/library_checker_aizu_tests/trees/subtree_isomorphism.test.cpp": "2026-02-14 20:58:21 +0000" +"tests/library_checker_aizu_tests/convolution/gcd_convolution.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/convolution/lcm_convolution.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/convolution/min_plus_convolution.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/binary_search_example.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/binary_trie.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/bit.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/bit_inc.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/bit_rupq.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/bit_rurq.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/bit_walk.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/deque.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/deque_index.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/deque_op.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/deque_sliding_window.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/disjoint_rmq_inc.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/disjoint_rmq_inc_lines.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/disjoint_rmq_inc_sum.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/distinct_query.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/dsu.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/dsu_bipartite.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/dsu_restorable.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/dsu_segtree_undo_trick.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/implicit_seg_tree.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/kruskal_tree_aizu.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/kth_smallest_wavelet_matrix.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/lazy_segment_tree.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/lazy_segment_tree_constructor.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/lazy_segment_tree_inc.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/lazy_segment_tree_inc_constructor.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/line_tree_aizu.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/line_tree_lib_checker.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/merge_sort_tree.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/permutation_tree.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/persistent_queue_tree.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/persistent_seg_tree.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/pq_ds_undo_sliding_window.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/pq_ds_undo_with_dsu.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/range_parallel_dsu.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/rmq_linear.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/rmq_sparse_table.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/rmq_sparse_table_inc.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/simple_tree.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/simple_tree_inc.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/simple_tree_inc_line.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/simple_tree_inc_walk.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/simple_tree_line.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/data_structures/simple_tree_walk.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/flow/dinic_aizu.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/flow/hungarian.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/flow/min_cost_max_flow.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/dijkstra_aizu.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/dijkstra_lib_checker.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/directed_cycle.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/enumerate_triangles.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/hopcroft_karp_aizu.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/hopcroft_karp_lib_checker.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/mst.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/graphs/two_edge_components.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/count_paths.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/dsu.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/dsu_size.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/edge_cd_small_trees.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/fib_matrix_expo.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/hilbert_mos.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/manacher.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/merge_st_and_wavelet.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/mobius.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/mod_division.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/n_choose_k.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/permutation_tree_small.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/rmq_small_n.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/sa_find_subarray.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/seg_tree_find.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/seg_tree_find_small.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/loops/chooses.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/loops/quotients.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/loops/submasks.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/loops/supermasks.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/binary_matrix_mult.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/count_paths.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/derangement.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/matrix_determinant.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/matrix_mult.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/n_choose_k.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/num_subsequences.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/partitions.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/prime_sieve.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/solve_linear_mod.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/tetration.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/totient.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/math/xor_basis_intersection.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/monotonic_stack_related/cartesian_binary_tree.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/monotonic_stack_related/cartesian_k_ary_tree.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/monotonic_stack_related/count_rectangles.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/monotonic_stack_related/max_rect_histogram.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/kmp.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/lcp_array.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/lcp_query_palindrome.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/lcp_query_zfunc.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/lcs_dp.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/lcs_queries.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/lcs_queries_merge_sort_tree.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/manacher.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/multi_matching_bs.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/prefix_function.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/sa_cmp.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/suffix_array.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/suffix_array_short.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/trie.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/strings/wildcard_pattern_matching.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/count_paths_per_length.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/edge_cd_contour_range_query.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/edge_cd_contour_range_update.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/edge_cd_count_paths_per_length.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/edge_cd_reroot_dp.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/hld_aizu1.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/hld_aizu2.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/hld_lib_checker_path.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/hld_lib_checker_subtree_edges.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/hld_lib_checker_subtree_nodes.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/kth_path_ladder.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/kth_path_linear.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/kth_path_tree_lift.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/lca_all_methods_aizu.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/lca_all_methods_lib_checker.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/shallowest_aizu_tree_height.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/shallowest_lib_checker_tree_path_composite.test.cpp": "2026-02-14 20:34:20 -0700", +"tests/library_checker_aizu_tests/trees/subtree_isomorphism.test.cpp": "2026-02-14 20:34:20 -0700" } \ No newline at end of file From eb9f7c91435288501fab5fbf7e73924a86c5538d Mon Sep 17 00:00:00 2001 From: Luke Videckis Date: Mon, 16 Feb 2026 13:02:48 -0700 Subject: [PATCH 3/4] golf --- library/data_structures_[l,r]/seg_tree_uncommon/walk.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/library/data_structures_[l,r]/seg_tree_uncommon/walk.hpp b/library/data_structures_[l,r]/seg_tree_uncommon/walk.hpp index 8ac6a6ca..4e8e60fc 100644 --- a/library/data_structures_[l,r]/seg_tree_uncommon/walk.hpp +++ b/library/data_structures_[l,r]/seg_tree_uncommon/walk.hpp @@ -1,10 +1,9 @@ int walk(int l, int r, const auto& f) { - l += n, r += n; - if (T x = s[l]; f(x)) + if (T x = s[l + n]; f(x)) for (l++; l <= r;) { - int v = __lg(min(l & -l, r - l + 1)); - if (T y = op(x, s[l >> v]); f(y)) l += 1 << v, x = y; + int u = l + n, v = __lg(min(u & -u, r - l + 1)); + if (T y = op(x, s[u >> v]); f(y)) l += 1 << v, x = y; else r = l + (1 << v) - 2; } - return l - n; + return l; } From 521aa939012df9efc3bfa2ffddecf050a9308e09 Mon Sep 17 00:00:00 2001 From: Luke Videckis Date: Mon, 16 Feb 2026 13:06:56 -0700 Subject: [PATCH 4/4] format --- .../data_structures/simple_tree_inc_walk.test.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/library_checker_aizu_tests/data_structures/simple_tree_inc_walk.test.cpp b/tests/library_checker_aizu_tests/data_structures/simple_tree_inc_walk.test.cpp index 386a7f30..f7865379 100644 --- a/tests/library_checker_aizu_tests/data_structures/simple_tree_inc_walk.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/simple_tree_inc_walk.test.cpp @@ -1,9 +1,7 @@ #define PROBLEM \ "https://judge.yosupo.jp/problem/predecessor_problem" #include "../template.hpp" -int __lg(unsigned x) { - return bit_width(x) - 1; -} +int __lg(unsigned x) { return bit_width(x) - 1; } #include "../../../library/data_structures_[l,r]/seg_tree.hpp" int main() { cin.tie(0)->sync_with_stdio(0);