From 35b1fb22aa501492f8eb48eeb54079dfe1cc7a31 Mon Sep 17 00:00:00 2001 From: Cameron Custer Date: Sun, 19 Jul 2026 14:11:46 -0700 Subject: [PATCH 1/6] fix pre-existing dev clang-format violations Reformat 5 files that violated the dev clang-format config (ColumnLimit 59) so the grep_clangformat_cppcheck CI job passes. Line-wrapping only; no behavior change. - library/dsu/kruskal_tree.hpp - library/strings/longest_common_subsequence/lcs_dp.hpp - library/strings/manacher/manacher.hpp - tests/.../data_structures/bit_ordered_set.test.cpp - tests/.../strings/sa_sort_pairs.test.cpp --- library/dsu/kruskal_tree.hpp | 3 ++- library/strings/longest_common_subsequence/lcs_dp.hpp | 4 +++- library/strings/manacher/manacher.hpp | 3 ++- .../data_structures/bit_ordered_set.test.cpp | 3 ++- .../library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp | 3 ++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/library/dsu/kruskal_tree.hpp b/library/dsu/kruskal_tree.hpp index 55f49f99..18beb231 100644 --- a/library/dsu/kruskal_tree.hpp +++ b/library/dsu/kruskal_tree.hpp @@ -1,6 +1,7 @@ #pragma once //! https://mzhang2021.github.io/cp-blog/kruskal/ -//! requires n >= 1 (2*n-1 allocation underflows when n == 0) +//! requires n >= 1 (2*n-1 allocation underflows when n == +//! 0) //! @time O(n log n) //! @space O(n) struct kr_tree { diff --git a/library/strings/longest_common_subsequence/lcs_dp.hpp b/library/strings/longest_common_subsequence/lcs_dp.hpp index 1892c709..ba6eafe0 100644 --- a/library/strings/longest_common_subsequence/lcs_dp.hpp +++ b/library/strings/longest_common_subsequence/lcs_dp.hpp @@ -10,7 +10,9 @@ template struct lcs_dp { T t; vi dp; - lcs_dp(const T& t): t(t), dp(sz(t)) { ranges::iota(dp, 0); } + lcs_dp(const T& t): t(t), dp(sz(t)) { + ranges::iota(dp, 0); + } void push_onto_s(int c) { int v = -1; rep(i, 0, sz(t)) if (c == t[i] || dp[i] < v) diff --git a/library/strings/manacher/manacher.hpp b/library/strings/manacher/manacher.hpp index 10ea292c..bb9d38ff 100644 --- a/library/strings/manacher/manacher.hpp +++ b/library/strings/manacher/manacher.hpp @@ -14,7 +14,8 @@ //! string b a a b a //! center 1 3 5 7 //! -//! requires n >= 1 (2*n-1 allocation underflows when n == 0) +//! requires n >= 1 (2*n-1 allocation underflows when n == +//! 0) //! @time O(n) //! @space O(n) vi manacher(const auto& s) { diff --git a/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp b/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp index 0f5ee379..1bf99923 100644 --- a/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp @@ -17,7 +17,8 @@ int main() { compress.push_back(x); } ranges::sort(compress); - compress.erase(begin(ranges::unique(compress)), end(compress)); + compress.erase(begin(ranges::unique(compress)), + end(compress)); BIT bit(sz(compress)); auto get_compressed_idx = [&](int val) -> int { int l = 0, r = sz(compress); diff --git a/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp b/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp index 7a9a3ba5..f2e92d05 100644 --- a/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp +++ b/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp @@ -10,7 +10,8 @@ int main() { for (int& x : arr) cin >> x; vi compress(arr); ranges::sort(compress); - compress.erase(begin(ranges::unique(compress)), end(compress)); + compress.erase(begin(ranges::unique(compress)), + end(compress)); for (int& x : arr) { int l = -1, r = int(sz(compress)); while (r - l > 1) { From 132963e041b878bd6e89e9c8dec456cf1dc453a7 Mon Sep 17 00:00:00 2001 From: GitHub Date: Sun, 19 Jul 2026 21:20:41 +0000 Subject: [PATCH 2/6] [auto-verifier] verify commit 35b1fb22aa501492f8eb48eeb54079dfe1cc7a31 --- .verify-helper/timestamps.remote.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index 4e8f9fcb..4bd055e8 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -8,7 +8,7 @@ "tests/library_checker_aizu_tests/data_structures/bit.test.cpp": "2026-07-10 20:39:22 -0700", "tests/library_checker_aizu_tests/data_structures/bit_inc.test.cpp": "2026-07-10 20:39:22 -0700", "tests/library_checker_aizu_tests/data_structures/bit_inc_walk.test.cpp": "2026-07-10 20:39:22 -0700", -"tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp": "2026-07-12 12:50:20 -0700", +"tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp": "2026-07-19 14:11:46 -0700", "tests/library_checker_aizu_tests/data_structures/bit_rupq.test.cpp": "2026-07-10 20:39:22 -0700", "tests/library_checker_aizu_tests/data_structures/bit_rurq.test.cpp": "2026-07-10 20:39:22 -0700", "tests/library_checker_aizu_tests/data_structures/bit_walk.test.cpp": "2026-07-10 20:39:22 -0700", @@ -49,9 +49,9 @@ "tests/library_checker_aizu_tests/dsu/dsu_bipartite.test.cpp": "2026-07-07 12:06:00 -0700", "tests/library_checker_aizu_tests/dsu/dsu_weighted_aizu.test.cpp": "2026-07-07 12:06:00 -0700", "tests/library_checker_aizu_tests/dsu/dsu_weighted_lib_checker.test.cpp": "2026-07-07 12:06:00 -0700", -"tests/library_checker_aizu_tests/dsu/kruskal_tree_aizu.test.cpp": "2026-07-12 10:49:50 -0700", +"tests/library_checker_aizu_tests/dsu/kruskal_tree_aizu.test.cpp": "2026-07-19 14:11:46 -0700", "tests/library_checker_aizu_tests/dsu/line_tree_aizu.test.cpp": "2026-07-12 12:50:20 -0700", -"tests/library_checker_aizu_tests/dsu/line_tree_lib_checker.test.cpp": "2026-07-12 12:50:20 -0700", +"tests/library_checker_aizu_tests/dsu/line_tree_lib_checker.test.cpp": "2026-07-19 14:11:46 -0700", "tests/library_checker_aizu_tests/dsu/range_parallel_dsu.test.cpp": "2026-07-09 23:01:31 -0500", "tests/library_checker_aizu_tests/flow/hungarian.test.cpp": "2026-07-07 12:06:00 -0700", "tests/library_checker_aizu_tests/flow/min_cost_max_flow.test.cpp": "2026-04-06 14:41:55 -0600", @@ -82,7 +82,7 @@ "tests/library_checker_aizu_tests/handmade_tests/hilbert_mos.test.cpp": "2026-07-10 20:39:22 -0700", "tests/library_checker_aizu_tests/handmade_tests/kd_bit.test.cpp": "2026-07-07 12:06:00 -0700", "tests/library_checker_aizu_tests/handmade_tests/kth_par.test.cpp": "2026-07-10 20:39:22 -0700", -"tests/library_checker_aizu_tests/handmade_tests/manacher.test.cpp": "2026-07-12 12:50:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/manacher.test.cpp": "2026-07-19 14:11:46 -0700", "tests/library_checker_aizu_tests/handmade_tests/merge_st_and_wavelet.test.cpp": "2026-07-07 12:06:00 -0700", "tests/library_checker_aizu_tests/handmade_tests/mobius.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/handmade_tests/mod_division.test.cpp": "2026-07-08 09:28:48 -0700", @@ -119,14 +119,14 @@ "tests/library_checker_aizu_tests/strings/lcp_array.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/strings/lcp_query_palindrome.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/strings/lcp_query_zfunc.test.cpp": "2026-07-12 12:50:20 -0700", -"tests/library_checker_aizu_tests/strings/lcs_dp.test.cpp": "2026-07-12 12:50:20 -0700", -"tests/library_checker_aizu_tests/strings/lcs_queries.test.cpp": "2026-07-12 12:50:20 -0700", -"tests/library_checker_aizu_tests/strings/lcs_queries_merge_sort_tree.test.cpp": "2026-07-12 12:50:20 -0700", -"tests/library_checker_aizu_tests/strings/manacher.test.cpp": "2026-07-12 10:49:50 -0700", +"tests/library_checker_aizu_tests/strings/lcs_dp.test.cpp": "2026-07-19 14:11:46 -0700", +"tests/library_checker_aizu_tests/strings/lcs_queries.test.cpp": "2026-07-19 14:11:46 -0700", +"tests/library_checker_aizu_tests/strings/lcs_queries_merge_sort_tree.test.cpp": "2026-07-19 14:11:46 -0700", +"tests/library_checker_aizu_tests/strings/manacher.test.cpp": "2026-07-19 14:11:46 -0700", "tests/library_checker_aizu_tests/strings/multi_matching_bs.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/strings/prefix_function.test.cpp": "2026-07-06 13:10:16 -0700", "tests/library_checker_aizu_tests/strings/sa_cmp.test.cpp": "2026-07-12 12:50:20 -0700", -"tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp": "2026-07-12 12:50:20 -0700", +"tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp": "2026-07-19 14:11:46 -0700", "tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/strings/suffix_array.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/strings/suffix_array_short.test.cpp": "2026-07-12 12:50:20 -0700", From 49f1f1806ab16b7288bb2f0cf82ad27680611aa6 Mon Sep 17 00:00:00 2001 From: Cameron Custer Date: Sun, 19 Jul 2026 14:30:27 -0700 Subject: [PATCH 3/6] sync stale cppcheck suppression line numbers The line-anchored knownConditionTrueFalse suppressions had drifted out of sync with their source lines, causing both unmatchedSuppression and now-unsuppressed errors in the cppcheck CI step: - kruskal_tree.hpp: 13 -> 15 (shifted by the clang-format reflow in the previous commit) - suffix_array.hpp: 62 -> 63 (pre-existing drift) - suffix_array_short.hpp: 34 -> 35 (pre-existing drift) --- tests/.config/.cppcheck_suppression_list | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/.config/.cppcheck_suppression_list b/tests/.config/.cppcheck_suppression_list index 49d1b2cf..e4b4cf8f 100644 --- a/tests/.config/.cppcheck_suppression_list +++ b/tests/.config/.cppcheck_suppression_list @@ -39,9 +39,9 @@ syntaxError:../library/loops/submasks.hpp:8 syntaxError:../library/loops/supermasks.hpp:8 syntaxError:../library/math/prime_sieve/mobius.hpp:6 syntaxError:../library/trees/lca_rmq/iterate_subtree.hpp:6 -knownConditionTrueFalse:../library/strings/suffix_array/suffix_array.hpp:62 -knownConditionTrueFalse:../library/strings/suffix_array/suffix_array_short.hpp:34 -knownConditionTrueFalse:../library/dsu/kruskal_tree.hpp:13 +knownConditionTrueFalse:../library/strings/suffix_array/suffix_array.hpp:63 +knownConditionTrueFalse:../library/strings/suffix_array/suffix_array_short.hpp:35 +knownConditionTrueFalse:../library/dsu/kruskal_tree.hpp:15 knownConditionTrueFalse:../library/dsu/dsu.hpp:11 knownConditionTrueFalse:../library/dsu/dsu_weighted.hpp:29 constVariable:../kactl/content/numerical/NumberTheoreticTransform.h:30 From 0152415812a48b1f9d7dba95a312b38bbbbc4f92 Mon Sep 17 00:00:00 2001 From: Cameron Custer Date: Sun, 19 Jul 2026 14:36:01 -0700 Subject: [PATCH 4/6] fix cppcheck mismatchingContainerExpression on ranges erase-remove cppcheck flags mixing iterators from two different expressions when the erase-remove idiom is written as erase(begin(ranges::unique(x)), end(x)): the first iterator comes from the returned subrange while the second comes from the container. Store the returned subrange in a local and erase [begin, end) of that single subrange, which is semantically identical (the subrange spans the trailing removed elements) and keeps both iterators from one expression. Applies to ranges::unique and ranges::remove_if call sites introduced in the ranges-algorithm migration (#244): - library/trees/extra_members/virtual_tree.hpp - tests .../bit_ordered_set.test.cpp - tests .../kth_smallest_pst.test.cpp - tests .../mode_query.test.cpp - tests .../sa_sort_pairs.test.cpp - tests .../single_matching_bs.test.cpp --- library/trees/extra_members/virtual_tree.hpp | 3 ++- .../data_structures/bit_ordered_set.test.cpp | 4 ++-- .../data_structures/kth_smallest_pst.test.cpp | 3 ++- .../data_structures/mode_query.test.cpp | 3 ++- .../strings/sa_sort_pairs.test.cpp | 4 ++-- .../strings/single_matching_bs.test.cpp | 7 +++---- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/library/trees/extra_members/virtual_tree.hpp b/library/trees/extra_members/virtual_tree.hpp index dfbd3d9f..8b803042 100644 --- a/library/trees/extra_members/virtual_tree.hpp +++ b/library/trees/extra_members/virtual_tree.hpp @@ -16,7 +16,8 @@ array compress_tree(vi subset) { rep(i, 1, len) subset.push_back(lca(subset[i - 1], subset[i])); ranges::sort(subset, {}, proj); - subset.erase(begin(ranges::unique(subset)), end(subset)); + auto dup = ranges::unique(subset); + subset.erase(begin(dup), end(dup)); return { mono_st(subset, [&](int u, int v) { return in_subtree(u, v); }), diff --git a/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp b/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp index 1bf99923..a3280438 100644 --- a/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp @@ -17,8 +17,8 @@ int main() { compress.push_back(x); } ranges::sort(compress); - compress.erase(begin(ranges::unique(compress)), - end(compress)); + auto dup = ranges::unique(compress); + compress.erase(begin(dup), end(dup)); BIT bit(sz(compress)); auto get_compressed_idx = [&](int val) -> int { int l = 0, r = sz(compress); diff --git a/tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp b/tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp index 10fdb7aa..56b0d0e4 100644 --- a/tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp @@ -10,7 +10,8 @@ int main() { rep(i, 0, n) cin >> arr[i]; vi sorted(arr); ranges::sort(sorted); - sorted.erase(begin(ranges::unique(sorted)), end(sorted)); + auto dup = ranges::unique(sorted); + sorted.erase(begin(dup), end(dup)); for (int& val : arr) { int start = 0, end = sz(sorted); while (start + 1 < end) { diff --git a/tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp b/tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp index de0edb0c..820aecdc 100644 --- a/tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp @@ -10,7 +10,8 @@ int main() { rep(i, 0, n) cin >> a[i]; vi comp(a); ranges::sort(comp); - comp.erase(begin(ranges::unique(comp)), end(comp)); + auto dup = ranges::unique(comp); + comp.erase(begin(dup), end(dup)); for (int& val : a) { int start = 0, end = sz(comp); while (start + 1 < end) { diff --git a/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp b/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp index f2e92d05..dfe03b94 100644 --- a/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp +++ b/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp @@ -10,8 +10,8 @@ int main() { for (int& x : arr) cin >> x; vi compress(arr); ranges::sort(compress); - compress.erase(begin(ranges::unique(compress)), - end(compress)); + auto dup = ranges::unique(compress); + compress.erase(begin(dup), end(dup)); for (int& x : arr) { int l = -1, r = int(sz(compress)); while (r - l > 1) { diff --git a/tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp b/tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp index df6ca928..945a6b57 100644 --- a/tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp +++ b/tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp @@ -69,10 +69,9 @@ int main() { assert(sa_ri2 - sa_le2 == 1 + sa_ri - sa_le); vi matches_other(begin(lq_both.sa) + sa_le2, begin(lq_both.sa) + sa_ri2); - matches_other.erase( - begin(ranges::remove_if(matches_other, - [&](int val) { return val >= sz(s) + 1; })), - end(matches_other)); + auto rem = ranges::remove_if(matches_other, + [&](int val) { return val >= sz(s) + 1; }); + matches_other.erase(begin(rem), end(rem)); ranges::sort(matches_other); assert(matches == matches_other); } From c87595d567ac573c05bd8730a5e9b2aa5ce01d8c Mon Sep 17 00:00:00 2001 From: GitHub Date: Sun, 19 Jul 2026 21:52:05 +0000 Subject: [PATCH 5/6] [auto-verifier] verify commit 0152415812a48b1f9d7dba95a312b38bbbbc4f92 --- .verify-helper/timestamps.remote.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index 4bd055e8..1c285d10 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -8,7 +8,7 @@ "tests/library_checker_aizu_tests/data_structures/bit.test.cpp": "2026-07-10 20:39:22 -0700", "tests/library_checker_aizu_tests/data_structures/bit_inc.test.cpp": "2026-07-10 20:39:22 -0700", "tests/library_checker_aizu_tests/data_structures/bit_inc_walk.test.cpp": "2026-07-10 20:39:22 -0700", -"tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp": "2026-07-19 14:11:46 -0700", +"tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp": "2026-07-19 14:36:01 -0700", "tests/library_checker_aizu_tests/data_structures/bit_rupq.test.cpp": "2026-07-10 20:39:22 -0700", "tests/library_checker_aizu_tests/data_structures/bit_rurq.test.cpp": "2026-07-10 20:39:22 -0700", "tests/library_checker_aizu_tests/data_structures/bit_walk.test.cpp": "2026-07-10 20:39:22 -0700", @@ -22,14 +22,14 @@ "tests/library_checker_aizu_tests/data_structures/distinct_query.test.cpp": "2026-07-07 10:02:09 -0700", "tests/library_checker_aizu_tests/data_structures/implicit_seg_tree.test.cpp": "2026-07-07 10:02:09 -0700", "tests/library_checker_aizu_tests/data_structures/kd_bit_1d.test.cpp": "2026-07-06 13:10:16 -0700", -"tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp": "2026-07-12 12:50:20 -0700", +"tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp": "2026-07-19 14:36:01 -0700", "tests/library_checker_aizu_tests/data_structures/kth_smallest_wavelet_matrix.test.cpp": "2026-07-07 12:06:00 -0700", "tests/library_checker_aizu_tests/data_structures/lazy_segment_tree.test.cpp": "2026-07-07 12:06:00 -0700", "tests/library_checker_aizu_tests/data_structures/lazy_segment_tree_constructor.test.cpp": "2026-07-07 12:06:00 -0700", "tests/library_checker_aizu_tests/data_structures/lazy_segment_tree_inc.test.cpp": "2026-07-06 13:10:16 -0700", "tests/library_checker_aizu_tests/data_structures/lazy_segment_tree_inc_constructor.test.cpp": "2026-07-06 13:10:16 -0700", "tests/library_checker_aizu_tests/data_structures/merge_sort_tree.test.cpp": "2026-07-06 13:10:16 -0700", -"tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp": "2026-07-12 12:50:20 -0700", +"tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp": "2026-07-19 14:36:01 -0700", "tests/library_checker_aizu_tests/data_structures/permutation_tree.test.cpp": "2026-07-09 23:01:31 -0500", "tests/library_checker_aizu_tests/data_structures/persistent_queue_tree.test.cpp": "2026-07-07 10:02:09 -0700", "tests/library_checker_aizu_tests/data_structures/persistent_seg_tree.test.cpp": "2026-07-07 10:02:09 -0700", @@ -74,7 +74,7 @@ "tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/graphs/two_edge_components.test.cpp": "2026-07-07 12:06:00 -0700", -"tests/library_checker_aizu_tests/handmade_tests/count_paths.test.cpp": "2026-07-12 12:50:20 -0700", +"tests/library_checker_aizu_tests/handmade_tests/count_paths.test.cpp": "2026-07-19 14:36:01 -0700", "tests/library_checker_aizu_tests/handmade_tests/dsu.test.cpp": "2026-07-07 12:06:00 -0700", "tests/library_checker_aizu_tests/handmade_tests/edge_cd_small_trees.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/handmade_tests/fib_matrix_expo.test.cpp": "2026-07-07 12:06:00 -0700", @@ -126,8 +126,8 @@ "tests/library_checker_aizu_tests/strings/multi_matching_bs.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/strings/prefix_function.test.cpp": "2026-07-06 13:10:16 -0700", "tests/library_checker_aizu_tests/strings/sa_cmp.test.cpp": "2026-07-12 12:50:20 -0700", -"tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp": "2026-07-19 14:11:46 -0700", -"tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp": "2026-07-12 12:50:20 -0700", +"tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp": "2026-07-19 14:36:01 -0700", +"tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp": "2026-07-19 14:36:01 -0700", "tests/library_checker_aizu_tests/strings/suffix_array.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/strings/suffix_array_short.test.cpp": "2026-07-12 12:50:20 -0700", "tests/library_checker_aizu_tests/strings/trie.test.cpp": "2026-07-06 13:10:16 -0700", @@ -142,12 +142,12 @@ "tests/library_checker_aizu_tests/trees/hld_lib_checker_path.test.cpp": "2026-07-10 20:39:22 -0700", "tests/library_checker_aizu_tests/trees/hld_lib_checker_subtree_edges.test.cpp": "2026-07-10 20:39:22 -0700", "tests/library_checker_aizu_tests/trees/hld_lib_checker_subtree_nodes.test.cpp": "2026-07-10 20:39:22 -0700", -"tests/library_checker_aizu_tests/trees/kth_path_hagerup.test.cpp": "2026-07-12 12:50:20 -0700", +"tests/library_checker_aizu_tests/trees/kth_path_hagerup.test.cpp": "2026-07-19 14:36:01 -0700", "tests/library_checker_aizu_tests/trees/kth_path_ladder.test.cpp": "2026-07-09 23:01:31 -0500", "tests/library_checker_aizu_tests/trees/kth_path_linear.test.cpp": "2026-07-10 20:39:22 -0700", -"tests/library_checker_aizu_tests/trees/kth_path_tree_lift.test.cpp": "2026-07-12 12:50:20 -0700", -"tests/library_checker_aizu_tests/trees/lca_all_methods_aizu.test.cpp": "2026-07-12 12:50:20 -0700", -"tests/library_checker_aizu_tests/trees/lca_all_methods_lib_checker.test.cpp": "2026-07-12 12:50:20 -0700", +"tests/library_checker_aizu_tests/trees/kth_path_tree_lift.test.cpp": "2026-07-19 14:36:01 -0700", +"tests/library_checker_aizu_tests/trees/lca_all_methods_aizu.test.cpp": "2026-07-19 14:36:01 -0700", +"tests/library_checker_aizu_tests/trees/lca_all_methods_lib_checker.test.cpp": "2026-07-19 14:36:01 -0700", "tests/library_checker_aizu_tests/trees/shallowest_aizu_tree_height.test.cpp": "2026-07-07 09:27:22 -0700", "tests/library_checker_aizu_tests/trees/shallowest_lib_checker_tree_path_composite.test.cpp": "2026-07-07 09:27:22 -0700", "tests/library_checker_aizu_tests/trees/subtree_isomorphism.test.cpp": "2026-07-07 09:27:22 -0700" From 828b3f0c06f3ab0d59fac30e143c50b9dcbf2292 Mon Sep 17 00:00:00 2001 From: Cameron Custer Date: Sun, 19 Jul 2026 15:27:57 -0700 Subject: [PATCH 6/6] suppress cppcheck mismatchingContainerExpression instead of rewriting Keep the terse erase-remove one-liners from the ranges migration (#244) and silence cppcheck's mismatchingContainerExpression false positive instead. The warning fires because a range algorithm returns a subrange, so the first iterator's source expression (ranges::unique(x)) differs syntactically from the second (end(x)) even though end(subrange) is end(x) by construction. Reverts the earlier local-variable rewrite and adds line-anchored suppressions for the six affected call sites. --- library/trees/extra_members/virtual_tree.hpp | 3 +-- tests/.config/.cppcheck_suppression_list | 6 ++++++ .../data_structures/bit_ordered_set.test.cpp | 4 ++-- .../data_structures/kth_smallest_pst.test.cpp | 3 +-- .../data_structures/mode_query.test.cpp | 3 +-- .../strings/sa_sort_pairs.test.cpp | 4 ++-- .../strings/single_matching_bs.test.cpp | 7 ++++--- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/library/trees/extra_members/virtual_tree.hpp b/library/trees/extra_members/virtual_tree.hpp index 8b803042..dfbd3d9f 100644 --- a/library/trees/extra_members/virtual_tree.hpp +++ b/library/trees/extra_members/virtual_tree.hpp @@ -16,8 +16,7 @@ array compress_tree(vi subset) { rep(i, 1, len) subset.push_back(lca(subset[i - 1], subset[i])); ranges::sort(subset, {}, proj); - auto dup = ranges::unique(subset); - subset.erase(begin(dup), end(dup)); + subset.erase(begin(ranges::unique(subset)), end(subset)); return { mono_st(subset, [&](int u, int v) { return in_subtree(u, v); }), diff --git a/tests/.config/.cppcheck_suppression_list b/tests/.config/.cppcheck_suppression_list index e4b4cf8f..fd9aef02 100644 --- a/tests/.config/.cppcheck_suppression_list +++ b/tests/.config/.cppcheck_suppression_list @@ -62,3 +62,9 @@ unusedFunction:../kactl/stress-tests/utilities/genTree.h:49 containerOutOfBounds:../library/data_structures_[l,r)/uncommon/permutation_tree.hpp:85 ctuOneDefinitionRuleViolation:../library/data_structures_[l,r)/bit.hpp:12 ctuOneDefinitionRuleViolation:../library/data_structures_[l,r)/lazy_seg_tree.hpp:4 +mismatchingContainerExpression:../library/trees/extra_members/virtual_tree.hpp:19 +mismatchingContainerExpression:library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp:20 +mismatchingContainerExpression:library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp:13 +mismatchingContainerExpression:library_checker_aizu_tests/data_structures/mode_query.test.cpp:13 +mismatchingContainerExpression:library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp:13 +mismatchingContainerExpression:library_checker_aizu_tests/strings/single_matching_bs.test.cpp:73 diff --git a/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp b/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp index a3280438..1bf99923 100644 --- a/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/bit_ordered_set.test.cpp @@ -17,8 +17,8 @@ int main() { compress.push_back(x); } ranges::sort(compress); - auto dup = ranges::unique(compress); - compress.erase(begin(dup), end(dup)); + compress.erase(begin(ranges::unique(compress)), + end(compress)); BIT bit(sz(compress)); auto get_compressed_idx = [&](int val) -> int { int l = 0, r = sz(compress); diff --git a/tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp b/tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp index 56b0d0e4..10fdb7aa 100644 --- a/tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/kth_smallest_pst.test.cpp @@ -10,8 +10,7 @@ int main() { rep(i, 0, n) cin >> arr[i]; vi sorted(arr); ranges::sort(sorted); - auto dup = ranges::unique(sorted); - sorted.erase(begin(dup), end(dup)); + sorted.erase(begin(ranges::unique(sorted)), end(sorted)); for (int& val : arr) { int start = 0, end = sz(sorted); while (start + 1 < end) { diff --git a/tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp b/tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp index 820aecdc..de0edb0c 100644 --- a/tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp +++ b/tests/library_checker_aizu_tests/data_structures/mode_query.test.cpp @@ -10,8 +10,7 @@ int main() { rep(i, 0, n) cin >> a[i]; vi comp(a); ranges::sort(comp); - auto dup = ranges::unique(comp); - comp.erase(begin(dup), end(dup)); + comp.erase(begin(ranges::unique(comp)), end(comp)); for (int& val : a) { int start = 0, end = sz(comp); while (start + 1 < end) { diff --git a/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp b/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp index dfe03b94..f2e92d05 100644 --- a/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp +++ b/tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp @@ -10,8 +10,8 @@ int main() { for (int& x : arr) cin >> x; vi compress(arr); ranges::sort(compress); - auto dup = ranges::unique(compress); - compress.erase(begin(dup), end(dup)); + compress.erase(begin(ranges::unique(compress)), + end(compress)); for (int& x : arr) { int l = -1, r = int(sz(compress)); while (r - l > 1) { diff --git a/tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp b/tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp index 945a6b57..df6ca928 100644 --- a/tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp +++ b/tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp @@ -69,9 +69,10 @@ int main() { assert(sa_ri2 - sa_le2 == 1 + sa_ri - sa_le); vi matches_other(begin(lq_both.sa) + sa_le2, begin(lq_both.sa) + sa_ri2); - auto rem = ranges::remove_if(matches_other, - [&](int val) { return val >= sz(s) + 1; }); - matches_other.erase(begin(rem), end(rem)); + matches_other.erase( + begin(ranges::remove_if(matches_other, + [&](int val) { return val >= sz(s) + 1; })), + end(matches_other)); ranges::sort(matches_other); assert(matches == matches_other); }