diff --git a/library/contest/random.hpp b/library/contest/random.hpp index 9a868d3e..67598965 100644 --- a/library/contest/random.hpp +++ b/library/contest/random.hpp @@ -5,7 +5,7 @@ //! uint64_t x1 = rng(); //! mt19937 rng; // fixed seed for debugging //! int x2 = rnd(0, 1); //random number in [0,1] -//! ll x3 = rnd(ll(1), ll(1e18)); +//! int64_t x3 = rnd(int64_t(1), int64_t(1e18)); //! @endcode mt19937 rng( chrono::steady_clock::now().time_since_epoch().count()); diff --git a/library/convolution/gcd_convolution.hpp b/library/convolution/gcd_convolution.hpp index 6af1f424..b83bce07 100644 --- a/library/convolution/gcd_convolution.hpp +++ b/library/convolution/gcd_convolution.hpp @@ -2,7 +2,7 @@ //! @code //! auto gcd_conv = gcd_convolution(a, b); //! @endcode -//! sz(a)==sz(b) +//! ssize(a)==ssize(b) //! gcd_conv[k] = sum of (a[i]*b[j]) //! for all pairs (i,j) where gcd(i,j)==k //! @time O(n log n) diff --git a/library/convolution/lcm_convolution.hpp b/library/convolution/lcm_convolution.hpp index 85449dc2..145bbc32 100644 --- a/library/convolution/lcm_convolution.hpp +++ b/library/convolution/lcm_convolution.hpp @@ -2,7 +2,7 @@ //! @code //! auto lcm_conv = lcm_convolution(a, b); //! @endcode -//! sz(a)==sz(b) +//! ssize(a)==ssize(b) //! lcm_conv[k] = sum of (a[i]*b[j]) //! for all pairs (i,j) where lcm(i,j)==k //! @time O(n log n) diff --git a/library/convolution/xor_convolution.hpp b/library/convolution/xor_convolution.hpp index c4893c70..a0ac95d7 100644 --- a/library/convolution/xor_convolution.hpp +++ b/library/convolution/xor_convolution.hpp @@ -2,8 +2,8 @@ #include "../math/mod_division.hpp" //! https://codeforces.com/blog/entry/127823 //! @code -//! vi c = xor_conv(a, b); -//! // must have sz(a) == sz(b) == a power of 2 +//! vector c = xor_conv(a, b); +//! // must have ssize(a) == ssize(b) == a power of 2 //! // c[k] = sum of a[i]*b[j] where i^j==k //! @endcode //! @time O(n log n) diff --git a/library/data_structures_[l,r)/bit.hpp b/library/data_structures_[l,r)/bit.hpp index 9b09c26e..164047be 100644 --- a/library/data_structures_[l,r)/bit.hpp +++ b/library/data_structures_[l,r)/bit.hpp @@ -1,7 +1,7 @@ #pragma once //! @code //! BIT bit(n); -//! bit.walk([&](int r, ll sum) -> bool { +//! bit.walk([&](int r, int64_t sum) -> bool { //! // sum = a[0] + a[1] + ... + a[r - 1] //! }); //! int r = bit.walk2(sum); diff --git a/library/data_structures_[l,r)/seg_tree.hpp b/library/data_structures_[l,r)/seg_tree.hpp index c2dac7f1..bac1c034 100644 --- a/library/data_structures_[l,r)/seg_tree.hpp +++ b/library/data_structures_[l,r)/seg_tree.hpp @@ -7,12 +7,12 @@ //! }); //! tree st(n, LLONG_MAX, ranges::min); //! int m1 = st.max_right(l, r, -//! [&](int m, ll value) -> bool { +//! [&](int m, int64_t value) -> bool { //! // l < m <= r //! // value = op(a[l], a[l+1], ..., a[m-1]) //! }); // max m such that f holds; l if none //! int m2 = st.min_left(l, r, -//! [&](int m, ll value) -> bool { +//! [&](int m, int64_t value) -> bool { //! // l <= m < r //! // value = op(a[m], ..., a[r-2], a[r-1]) //! }); // min m such that f holds; r if none 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 38969d19..e8524438 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 @@ -1,9 +1,9 @@ #pragma once //! @code //! seg_tree st(n); -//! st.find_first(l, r, [&](ll x, int tl, int tr) -> -//! bool { -//! }); +//! st.find_first(l, r, +//! [&](int64_t x, int tl, int tr) -> bool { +//! }); //! @endcode //! @param l,r defines range [l, r) //! @param f defines a function that returns 1 if the 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 8086996c..0f8519f6 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 @@ -1,9 +1,9 @@ #pragma once //! @code //! seg_tree st(n); -//! st.find_last(l, r, [&](ll x, int tl, int tr) -> -//! bool { -//! }); +//! st.find_last(l, r, +//! [&](int64_t x, int tl, int tr) -> bool { +//! }); //! @endcode //! @param l,r defines range [l, r) //! @param f defines a function that returns 1 if the diff --git a/library/data_structures_[l,r)/seg_tree_uncommon/wavelet_matrix.hpp b/library/data_structures_[l,r)/seg_tree_uncommon/wavelet_matrix.hpp index ace057d8..3ca6259c 100644 --- a/library/data_structures_[l,r)/seg_tree_uncommon/wavelet_matrix.hpp +++ b/library/data_structures_[l,r)/seg_tree_uncommon/wavelet_matrix.hpp @@ -2,7 +2,7 @@ #include "wavelet_bit_vec.hpp" //! https://nyaannyaan.github.io/library/data-structure-2d/wavelet-matrix.hpp //! @code -//! vector a(n); +//! vector a(n); //! wavelet_matrix wm(a, 30); // 0 <= a[i] < (1<<30) //! wm.kth(l, r, k); //(k+1)th smallest number in [l,r) //! wm.kth(l, r, 0); //min in [l,r) diff --git a/library/data_structures_[l,r)/uncommon/permutation_tree.hpp b/library/data_structures_[l,r)/uncommon/permutation_tree.hpp index 1200e621..ecffabc4 100644 --- a/library/data_structures_[l,r)/uncommon/permutation_tree.hpp +++ b/library/data_structures_[l,r)/uncommon/permutation_tree.hpp @@ -7,7 +7,7 @@ //! [p[v].mn_idx, p[v].mn_idx+p[v].len) index range //! [p[v].mn_num, p[v].mn_num+p[v].len) number range //! indexes [0, n) of ch are leaves -//! indexes [n, sz(ch)) of ch are internal nodes +//! indexes [n, ssize(ch)) of ch are internal nodes //! @time O(n) //! @space O(n) struct perm_tree { diff --git a/library/data_structures_[l,r]/bit.hpp b/library/data_structures_[l,r]/bit.hpp index 754280ba..e720d7ce 100644 --- a/library/data_structures_[l,r]/bit.hpp +++ b/library/data_structures_[l,r]/bit.hpp @@ -1,7 +1,7 @@ #pragma once //! @code //! BIT bit(n); -//! bit.walk([&](int r, ll sum) -> bool { +//! bit.walk([&](int r, int64_t sum) -> bool { //! // sum = a[0] + a[1] + ... + a[r] //! }); //! int r = bit.walk2(sum); diff --git a/library/data_structures_[l,r]/seg_tree.hpp b/library/data_structures_[l,r]/seg_tree.hpp index fcb949a6..058cf4c8 100644 --- a/library/data_structures_[l,r]/seg_tree.hpp +++ b/library/data_structures_[l,r]/seg_tree.hpp @@ -6,12 +6,12 @@ //! }); //! tree st(n, LLONG_MAX, ranges::min); //! int m1 = st.max_right(l, r, -//! [&](int m, ll value) -> bool { +//! [&](int m, int64_t value) -> bool { //! // l <= m <= r //! // value = op(a[l], a[l+1], ..., a[m]) //! }); // min m such that f fails; r+1 if none //! int m2 = st.min_left(l, r, -//! [&](int m, ll value) -> bool { +//! [&](int m, int64_t value) -> bool { //! // l <= m <= r //! // value = op(a[m], ..., a[r-1], a[r]) //! }); // max m such that f fails; l-1 if none diff --git a/library/dsu/dsu_weighted.hpp b/library/dsu/dsu_weighted.hpp index 1f504992..aca589c6 100644 --- a/library/dsu/dsu_weighted.hpp +++ b/library/dsu/dsu_weighted.hpp @@ -3,7 +3,7 @@ //! dsu_weighted dsu(n); //! dsu.join(u, v, w); //! // we now know a[u] = a[v] + w -//! ll w = dsu.diff(u, v); +//! int64_t w = dsu.diff(u, v); //! // satisfies a[u] = a[v] + w based on prior joins //! @endcode //! @time O(n + q * \alpha(n)) diff --git a/library/dsu/range_parallel_equivalence_classes.hpp b/library/dsu/range_parallel_equivalence_classes.hpp index fdbcf1c0..9cae9887 100644 --- a/library/dsu/range_parallel_equivalence_classes.hpp +++ b/library/dsu/range_parallel_equivalence_classes.hpp @@ -1,7 +1,7 @@ #pragma once #include "dsu.hpp" //! @code -//! vector> joins(n + 1); +//! vector>> joins(n + 1); //! joins[len].emplace_back(u, v); //! // it does: //! // dsu.join(u + 0, v + 0); diff --git a/library/flow/hungarian.hpp b/library/flow/hungarian.hpp index 05b05a01..726c8ddb 100644 --- a/library/flow/hungarian.hpp +++ b/library/flow/hungarian.hpp @@ -1,7 +1,7 @@ #pragma once //! https://e-maxx.ru/algo/assignment_hungary //! @code -//! vector cost(n+1,vector(m+1,ll(0))); +//! vector cost(n+1,vector(m+1,int64_t(0))); //! auto [min_weight, l_to_r] = hungarian(cost); //! @endcode //! cost[i][j] = edge weight, 1<=i<=n<=m; 1<=j<=m diff --git a/library/graphs/bcc_callback.hpp b/library/graphs/bcc_callback.hpp index a9a26adb..8417ab52 100644 --- a/library/graphs/bcc_callback.hpp +++ b/library/graphs/bcc_callback.hpp @@ -2,12 +2,12 @@ //! https://cp-algorithms.com/graph/cutpoints.html //! @code //! { -//! vector g(n); +//! vector> g(n); //! DSU dsu(n); //! vector vis(n); -//! bcc(g, [&](const vi& nodes) { +//! bcc(g, [&](const vector& nodes) { //! int cnt_edges = 0; -//! rep (i, 0, sz(nodes) - 1) { +//! for (int i = 0; i < ssize(nodes) - 1; i++) { //! vis[nodes[i]] = 1; //! for (int u : g[nodes[i]]) if (!vis[u]) { //! // edge nodes[i] <=> u is in current BCC @@ -21,7 +21,7 @@ //! for (int u : nodes) dsu.join(u, nodes[0]); //! }); //! vector> bridge_tree(n); -//! rep (i, 0, n) +//! for (int i = 0; i < n; i++) //! for (int u : g[i]) //! if (dsu.f(i) != dsu.f(u)) //! bridge_tree[dsu.f(i)] += dsu.f(u); @@ -30,7 +30,7 @@ //! vector> g(n); //! vector> block_vertex_tree(2 * n); //! int bcc_id = n; -//! bcc(g, [&](const vi& nodes) { +//! bcc(g, [&](const vector& nodes) { //! for (int u : nodes) { //! block_vertex_tree[u] += bcc_id; //! block_vertex_tree[bcc_id] += u; diff --git a/library/graphs/euler_path.hpp b/library/graphs/euler_path.hpp index cd423a2b..066923b3 100644 --- a/library/graphs/euler_path.hpp +++ b/library/graphs/euler_path.hpp @@ -1,15 +1,16 @@ #pragma once //! @code //! vector>> g(n); -//! vector edges(m); -//! rep(i, 0, m) { +//! vector> edges(m); +//! for (int i = 0; i < m; i++) { //! int u, v; //! cin >> u >> v; //! u--, v--; //! g[u] += {v, i}; //! edges[i] = {u, v}; //! } -//! vector path = euler_path(g, m, source); +//! vector> path = +//! euler_path(g, m, source); //! @endcode //! @time O(n + m) //! @space O(n + m) diff --git a/library/graphs/min_vertex_cover.hpp b/library/graphs/min_vertex_cover.hpp index 24fcc23d..764ee978 100644 --- a/library/graphs/min_vertex_cover.hpp +++ b/library/graphs/min_vertex_cover.hpp @@ -1,9 +1,9 @@ #include "../../kactl/content/graph/HopcroftKarp.h" //! @code //! int l_sz, r_sz; -//! vector g(l_sz); +//! vector> g(l_sz); //! g[u].push_back(v); // 0 <= u < l_sz, 0 <= v < r_sz -//! vi r(r_sz, -1); +//! vector r(r_sz, -1); //! int match_sz = hopcroftKarp(g, r); //! // r[v] != -1 iff edge r[v] <-> v in matching //! auto [mvc_l, mvc_r] = cover(g, r); diff --git a/library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp b/library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp index 5df1016b..66b7c96d 100644 --- a/library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp +++ b/library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp @@ -9,7 +9,7 @@ //! //! @code //! auto [num_sccs, scc_id] = scc(g); -//! vector edges = extra_edges(g, +//! vector> edges = extra_edges(g, //! num_sccs, scc_id); //! @endcode //! @param g,num_sccs,scc_id directed graph and its SCCs diff --git a/library/graphs/uncommon/bridges.hpp b/library/graphs/uncommon/bridges.hpp index 90198fa3..ca1bf931 100644 --- a/library/graphs/uncommon/bridges.hpp +++ b/library/graphs/uncommon/bridges.hpp @@ -2,7 +2,7 @@ //! https://cp-algorithms.com/graph/bridge-searching.html //! @code //! vector>> g(n); -//! rep (i, 0, m) { +//! for (int i = 0; i < m; i++) { //! int u, v; //! cin >> u >> v; //! u--, v--; diff --git a/library/graphs/uncommon/complement_graph_ccs.hpp b/library/graphs/uncommon/complement_graph_ccs.hpp index a69e8d3f..0da0f6c7 100644 --- a/library/graphs/uncommon/complement_graph_ccs.hpp +++ b/library/graphs/uncommon/complement_graph_ccs.hpp @@ -1,7 +1,7 @@ #pragma once //! @code //! vector> g; -//! vi cc_id = get_complement_graph_ccs(g); +//! vector cc_id = get_complement_graph_ccs(g); //! @endcode //! 0<=cc_id[v]>> g(n); -//! rep (i, 0, m) { +//! for (int i = 0; i < m; i++) { //! int u, v; //! cin >> u >> v; //! u--, v--; diff --git a/library/math/count_paths/count_paths_triangle.hpp b/library/math/count_paths/count_paths_triangle.hpp index 77070982..e7ab203d 100644 --- a/library/math/count_paths/count_paths_triangle.hpp +++ b/library/math/count_paths/count_paths_triangle.hpp @@ -1,7 +1,8 @@ #pragma once #include "count_paths_rectangle.hpp" //! https://noshi91.hatenablog.com/entry/2023/07/21/235339 -//! @time O((n + m)log^2(n + m)): n = sz(h); m = h.back() +//! @time O((n + m)log^2(n + m)): +//! n = ssize(h); m = h.back() //! @space O(n + m) vl divide_and_conquer(vl h, vl bottom) { { diff --git a/library/math/fibonacci.hpp b/library/math/fibonacci.hpp index f0de2014..8ee450f2 100644 --- a/library/math/fibonacci.hpp +++ b/library/math/fibonacci.hpp @@ -2,7 +2,7 @@ //! https://codeforces.com/blog/entry/14516 //! https://cp-algorithms.com/algebra/fibonacci-numbers.html#fast-doubling-method //! @code -//! ll num = fib(n)[0]; +//! int64_t num = fib(n)[0]; //! //n=0 -> num=0 //! //n=1 -> num=1 //! //n=2 -> num=1 diff --git a/library/math/matrix_related/xor_basis_unordered.hpp b/library/math/matrix_related/xor_basis_unordered.hpp index 226e0cb1..3d9fff06 100644 --- a/library/math/matrix_related/xor_basis_unordered.hpp +++ b/library/math/matrix_related/xor_basis_unordered.hpp @@ -4,7 +4,8 @@ //! properties: //! - shrink(v) == shrink(shrink(v)) //! - for x in b: (bit_floor(x) & shrink(v)) == 0 -//! - for 0 <= i < j < sz(b): (bit_floor(b[i]) & b[j]) == 0 +//! - for 0 <= i < j < ssize(b): +//! (bit_floor(b[i]) & b[j]) == 0 //! @time O(32) //! @space O(32) struct basis { diff --git a/library/monotonic_stack/monotonic_range.hpp b/library/monotonic_stack/monotonic_range.hpp index 0af8ffb9..ec565ffa 100644 --- a/library/monotonic_stack/monotonic_range.hpp +++ b/library/monotonic_stack/monotonic_range.hpp @@ -1,7 +1,8 @@ #pragma once #include "monotonic_stack.hpp" //! @code -//! vi le = mono_st(a, less()), ri = mono_range(le); +//! vector le = mono_st(a, less()), +//! ri = mono_range(le); //! // less_equal(), greater(), greater_equal() //! @endcode //! when cmp == less(): diff --git a/library/monotonic_stack/monotonic_stack.hpp b/library/monotonic_stack/monotonic_stack.hpp index a133d804..eabdd2e2 100644 --- a/library/monotonic_stack/monotonic_stack.hpp +++ b/library/monotonic_stack/monotonic_stack.hpp @@ -1,6 +1,6 @@ #pragma once //! @code -//! vi le = mono_st(a, less()); +//! vector le = mono_st(a, less()); //! // less_equal(), greater(), greater_equal() //! @endcode //! when cmp == less(): diff --git a/library/strings/kmp.hpp b/library/strings/kmp.hpp index c691faae..c4b4988e 100644 --- a/library/strings/kmp.hpp +++ b/library/strings/kmp.hpp @@ -4,11 +4,11 @@ //! string s,t; //! KMP kmp(t); //! auto match = kmp.find_str(s); -//! vi s_vec,t_vec; +//! vector s_vec,t_vec; //! KMP kmp1(t_vec); //! auto match2 = kmp1.find_str(s_vec); //! @endcode -//! if match[i] == 1 then s[i,sz(t)) == t +//! if match[i] == 1 then s[i,ssize(t)) == t //! @time O(|s| + |t|) //! @space O(|s| + |t|) // NOLINTNEXTLINE(readability-identifier-naming) diff --git a/library/strings/longest_common_subsequence/lcs_queries.hpp b/library/strings/longest_common_subsequence/lcs_queries.hpp index f904bca1..ccd29d70 100644 --- a/library/strings/longest_common_subsequence/lcs_queries.hpp +++ b/library/strings/longest_common_subsequence/lcs_queries.hpp @@ -3,9 +3,10 @@ #include "lcs_dp.hpp" //! @code //! string s,t; -//! vi lcs_len = lcs_queries(s, t, queries); -//! vi s_vec,t_vec; -//! vi lcs_len1 = lcs_queries(s_vec, t_vec, queries); +//! vector lcs_len = lcs_queries(s, t, queries); +//! vector s_vec,t_vec; +//! vector lcs_len1 = +//! lcs_queries(s_vec, t_vec, queries); //! @endcode //! lcs_len[i] = size(LCS( //! s[0,queries[i][0]), diff --git a/library/strings/manacher/manacher.hpp b/library/strings/manacher/manacher.hpp index aa6fd629..fa1f7514 100644 --- a/library/strings/manacher/manacher.hpp +++ b/library/strings/manacher/manacher.hpp @@ -3,7 +3,7 @@ //! @code //! string s; //! auto man = manacher(s); -//! vi s_vec; +//! vector s_vec; //! auto man1 = manacher(s_vec); //! @endcode //! diff --git a/library/strings/suffix_array/find/find_string_bs.hpp b/library/strings/suffix_array/find/find_string_bs.hpp index 9bbdc231..e840dce1 100644 --- a/library/strings/suffix_array/find/find_string_bs.hpp +++ b/library/strings/suffix_array/find/find_string_bs.hpp @@ -1,7 +1,7 @@ #pragma once //! https://github.com/yosupo06/Algorithm/blob/master/src/string/suffixarray.hpp //! returns range [l,r) such that: -//! - for all i in [l,r): t==s.substr(sa[i],sz(t)) +//! - for all i in [l,r): t==s.substr(sa[i],ssize(t)) //! - `r-l` is the # of matches of t in s. //! @time O(|t| * log(|s|)) //! @space O(1) diff --git a/library/strings/suffix_array/find/find_substrings_concatenated.hpp b/library/strings/suffix_array/find/find_substrings_concatenated.hpp index b94d4e53..10af4a02 100644 --- a/library/strings/suffix_array/find/find_substrings_concatenated.hpp +++ b/library/strings/suffix_array/find/find_substrings_concatenated.hpp @@ -9,7 +9,7 @@ //! substrs.back()[0]) //! - doesn't work when substrs[i][0] == n //! @returns see match -//! @time O(sz(substrs) * log(|s|)) +//! @time O(ssize(substrs) * log(|s|)) //! @space O(1) match find_substrs_concated(const vector& substrs) { using dt = array; diff --git a/library/strings/suffix_array/find/match.hpp b/library/strings/suffix_array/find/match.hpp index efa9e39b..5aa5ce49 100644 --- a/library/strings/suffix_array/find/match.hpp +++ b/library/strings/suffix_array/find/match.hpp @@ -1,6 +1,6 @@ #pragma once //! for all i in [sa_le,sa_ri): -//! - t==s.substr(sa[i],sz(t)) +//! - t==s.substr(sa[i],ssize(t)) //! - `sa_ri-sa_le` is the # of matches of t in s. //! //! if sa_le==sa_ri then: diff --git a/library/strings/suffix_array/suffix_array.hpp b/library/strings/suffix_array/suffix_array.hpp index cdeda4ec..1b8ed537 100644 --- a/library/strings/suffix_array/suffix_array.hpp +++ b/library/strings/suffix_array/suffix_array.hpp @@ -28,7 +28,7 @@ //! // requires 0<=s[i] s_vec; //! auto [sa1, sa_inv1, lcp1] = get_sa(s_vec, 100'001); //! @endcode //! diff --git a/library/strings/suffix_array/suffix_array_query.hpp b/library/strings/suffix_array/suffix_array_query.hpp index 8f39c66c..d2143c2b 100644 --- a/library/strings/suffix_array/suffix_array_query.hpp +++ b/library/strings/suffix_array/suffix_array_query.hpp @@ -6,7 +6,7 @@ //! string s; //! auto [sa, sa_inv, lcp] = get_sa(s, 256); //! sa_query saq(s, sa, sa_inv, lcp); -//! vi s_vec; +//! vector s_vec; //! auto [sa1, sa_inv1, lcp1] = sa_short(s_vec); //! sa_query saq1(s_vec, sa1, sa_inv1, lcp1); //! @endcode diff --git a/library/strings/suffix_array/suffix_array_short.hpp b/library/strings/suffix_array/suffix_array_short.hpp index 0bed91a0..ea383be6 100644 --- a/library/strings/suffix_array/suffix_array_short.hpp +++ b/library/strings/suffix_array/suffix_array_short.hpp @@ -4,7 +4,7 @@ //! // requires s[i]>=0 //! string s; //! auto [sa, sa_inv, lcp] = sa_short(s); -//! vi s_vec; +//! vector s_vec; //! auto [sa1, sa_inv1, lcp1] = sa_short(s_vec); //! @endcode //! about 2-3x slower than KACTL diff --git a/library/strings/wildcard_pattern_matching.hpp b/library/strings/wildcard_pattern_matching.hpp index c30d91cf..f4632757 100644 --- a/library/strings/wildcard_pattern_matching.hpp +++ b/library/strings/wildcard_pattern_matching.hpp @@ -5,7 +5,7 @@ //! auto mtch = wildcard_pattern_matching( //! s_vec, t_vec, conv); //! @endcode -//! s_vec[mtch[i],sz(t_vec)) == t_vec +//! s_vec[mtch[i],ssize(t_vec)) == t_vec //! s_vec[i]=0 or t_vec[i]=0 for a wildcard //! @time O((n+m) log (n+m)) //! @space O(n+m) diff --git a/library/trees/centroid_decomp.hpp b/library/trees/centroid_decomp.hpp index 5d224205..48e7d107 100644 --- a/library/trees/centroid_decomp.hpp +++ b/library/trees/centroid_decomp.hpp @@ -2,7 +2,7 @@ //! https://codeforces.com/blog/entry/125866?#comment-1117826 //! @code //! vector> g(n); -//! vi p = cd(g, [&](int c) {}); +//! vector p = cd(g, [&](int c) {}); //! @endcode //! @time O(n log n) //! @space O(n) diff --git a/library/trees/edge_cd.hpp b/library/trees/edge_cd.hpp index e7bf63b9..fab377b0 100644 --- a/library/trees/edge_cd.hpp +++ b/library/trees/edge_cd.hpp @@ -7,7 +7,7 @@ //! vector> g(n); //! edge_cd(g, [&](int c, int m) { //! // subtrees of [0, m) of g[c]: 1st edge-set -//! // subtrees of [m, sz(g[c])): 2nd edge-set +//! // subtrees of [m, ssize(g[c])): 2nd edge-set //! }); //! @endcode //! handle single-edge-paths separately diff --git a/library/trees/extra_members/next_on_path.hpp b/library/trees/extra_members/next_on_path.hpp index d9bb2bd1..a9c64ec5 100644 --- a/library/trees/extra_members/next_on_path.hpp +++ b/library/trees/extra_members/next_on_path.hpp @@ -1,6 +1,7 @@ #pragma once //! https://codeforces.com/blog/entry/71567?#comment-559285 -//! returns the node vi({u,p[u],..,lca(u,v),..,p[v],v})[1] +//! returns the node +//! vector({u,p[u],..,lca(u,v),..,p[v],v})[1] //! @time O(1) //! @space O(1) int next_on_path(int u, int v) { diff --git a/library/trees/extra_members/virtual_tree.hpp b/library/trees/extra_members/virtual_tree.hpp index 2526dc0e..824ac32b 100644 --- a/library/trees/extra_members/virtual_tree.hpp +++ b/library/trees/extra_members/virtual_tree.hpp @@ -1,6 +1,6 @@ //! https://github.com/kth-competitive-programming/kactl/blob/main/content/graph/CompressTree.h //! @code -//! vector g(n); +//! vector> g(n); //! LCA lca(g); //! auto [par, orig_node] = //! lca.compress_tree(subset); diff --git a/tests/.config/.cppcheck_suppression_list b/tests/.config/.cppcheck_suppression_list index 8aef4c91..0cc08ae8 100644 --- a/tests/.config/.cppcheck_suppression_list +++ b/tests/.config/.cppcheck_suppression_list @@ -15,8 +15,8 @@ negativeContainerIndex:../library/strings/suffix_array/burrows_wheeler.hpp:50 useStlAlgorithm:../kactl/content/numerical/FastFourierTransform.h:53 useStlAlgorithm:../library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp:58 useStlAlgorithm:../library/math/matrix_related/row_reduce.hpp:28 -useStlAlgorithm:../library/math/count_paths/count_paths_triangle.hpp:24 -useStlAlgorithm:../library/math/matrix_related/xor_basis_unordered.hpp:13 +useStlAlgorithm:../library/math/count_paths/count_paths_triangle.hpp:25 +useStlAlgorithm:../library/math/matrix_related/xor_basis_unordered.hpp:14 shadowFunction:../kactl/content/graph/BinaryLifting.h:17 unknownMacro:../kactl/content/graph/BinaryLifting.h:18 constParameter:../kactl/content/graph/BinaryLifting.h:29 diff --git a/tests/scripts/grep_clangformat_cppcheck.sh b/tests/scripts/grep_clangformat_cppcheck.sh index f38184cc..4e31e4a3 100755 --- a/tests/scripts/grep_clangformat_cppcheck.sh +++ b/tests/scripts/grep_clangformat_cppcheck.sh @@ -13,18 +13,22 @@ grep "endl" --recursive library_checker_aizu_tests/ && exit 1 echo "check template over template:" grep --extended-regexp "template\s?" -grep "pair" --recursive ../library/**/*.hpp && exit 1 +grep "pair" --recursive ../library/**/*.hpp | grep --invert-match --extended-regexp "$comment_line" && exit 1 echo "check sz instead of ssize" -grep "ssize" --recursive ../library/ && exit 1 +grep "ssize" --recursive ../library/ | grep --invert-match --extended-regexp "$comment_line" && exit 1 echo "check vi instead of vector" -grep "vector" --recursive ../library/**/*.hpp && exit 1 +grep "vector" --recursive ../library/**/*.hpp | grep --invert-match --extended-regexp "$comment_line" && exit 1 echo "check begin(arr) instead of arr.begin(), similarly for end, rbegin, rend, empty, size:" grep --recursive ../library/ library_checker_aizu_tests/ --fixed-strings --regexp=".begin()" --regexp=".rbegin()" --regexp=".end()" --regexp=".rend()" --regexp=".empty()" --regexp=".size()" && exit 1