Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d8423ae
change push_back to += for basic strings
lrvideckis Jan 24, 2025
3429086
switch to clang format version 19 to match arch local version
lrvideckis Jan 24, 2025
2ee0a0c
trying this
lrvideckis Jan 24, 2025
ed0bce7
trying this now
lrvideckis Jan 24, 2025
970c006
Revert "switch to clang format version 19 to match arch local version"
lrvideckis Jan 24, 2025
f725f1f
revert formatting of some files
lrvideckis Jan 24, 2025
a875b60
fix some things
lrvideckis Jan 24, 2025
df7c4c9
[auto-verifier] verify commit a875b601e59cdcdc5f42774a77076d53fdf5deff
web-flow Jan 24, 2025
14968cf
more fixes
lrvideckis Feb 10, 2025
4a34621
suppress another buggy clang tidy warning
lrvideckis Feb 10, 2025
3f655a2
more fixes
lrvideckis Feb 10, 2025
5eef2d6
convert another one to basic string
lrvideckis Feb 10, 2025
196f126
another one
lrvideckis Feb 10, 2025
86f5ee9
format
lrvideckis Feb 10, 2025
3647c74
convert another to basic string
lrvideckis Feb 10, 2025
68b7147
another one
lrvideckis Feb 10, 2025
1631218
another one
lrvideckis Feb 10, 2025
3a969a6
another one
lrvideckis Feb 10, 2025
547087a
another one
lrvideckis Feb 10, 2025
ab75352
another one
lrvideckis Feb 10, 2025
83d97f6
trying this
lrvideckis Feb 10, 2025
3e87b94
fix compile error in example init comment
lrvideckis Feb 10, 2025
b067305
another fix
lrvideckis Feb 10, 2025
a143064
yet another fix
lrvideckis Feb 10, 2025
7b2cf61
trying thisasdfkljasdfaslkdjf
lrvideckis Feb 10, 2025
eb0878f
new version of clang?
lrvideckis Feb 10, 2025
582aa20
[auto-verifier] verify commit eb0878fb921340b6ac67703981954f114fbebeb1
web-flow Feb 10, 2025
99eac09
Merge branch 'dev' into plus_equals_basic_string
lrvideckis Feb 11, 2025
bbb2a2e
switch back ladder decomp
lrvideckis Feb 11, 2025
d792b2c
now formatted
lrvideckis Feb 11, 2025
96931a4
fix cppcheck
lrvideckis Feb 11, 2025
01eabf5
switch over another place
lrvideckis Feb 11, 2025
8c0ff8b
another place
lrvideckis Feb 11, 2025
ee1a2ae
allow basic string for graph input
lrvideckis Feb 11, 2025
e9e1681
switch another place
lrvideckis Feb 11, 2025
b0d2ea7
changed another place
lrvideckis Feb 11, 2025
436c0d0
another suppression
lrvideckis Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 7 additions & 49 deletions .verify-helper/timestamps.remote.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,39 +50,19 @@
"tests/library_checker_aizu_tests/flow/dinic_aizu.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/flow/hungarian.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/flow/min_cost_max_flow.test.cpp": "2024-12-05 10:41:42 -0600",
"tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp": "2024-12-15 09:01:54 -0600",
"tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp": "2025-02-10 14:02:17 -0700",
"tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/graphs/dijkstra_aizu.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/graphs/dijkstra_lib_checker.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/graphs/directed_cycle.test.cpp": "2025-01-15 00:11:15 -0700",
"tests/library_checker_aizu_tests/graphs/enumerate_triangles.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/graphs/hopcroft_karp_aizu.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/graphs/hopcroft_karp_lib_checker.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/graphs/directed_cycle.test.cpp": "2025-02-10 13:50:35 -0700",
"tests/library_checker_aizu_tests/graphs/enumerate_triangles.test.cpp": "2025-02-10 13:47:58 -0700",
"tests/library_checker_aizu_tests/graphs/hopcroft_karp_aizu.test.cpp": "2025-01-24 10:59:16 -0700",
"tests/library_checker_aizu_tests/graphs/hopcroft_karp_lib_checker.test.cpp": "2025-01-24 10:59:16 -0700",
"tests/library_checker_aizu_tests/graphs/mst.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/graphs/two_edge_components.test.cpp": "2024-12-15 09:01:54 -0600",
"tests/library_checker_aizu_tests/handmade_tests/count_paths_forest.test.cpp": "2024-12-15 14:34:10 -0600",
"tests/library_checker_aizu_tests/handmade_tests/dsu_size.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/handmade_tests/edge_cd_small_trees.test.cpp": "2024-12-15 17:01:11 -0600",
"tests/library_checker_aizu_tests/handmade_tests/fib_matrix_expo.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp": "2024-12-15 17:01:11 -0600",
"tests/library_checker_aizu_tests/handmade_tests/lca_ladder_forest.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/handmade_tests/manacher.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/handmade_tests/merge_st_and_wavelet.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/handmade_tests/mobius.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/handmade_tests/mod_int.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/handmade_tests/n_choose_k.test.cpp": "2025-01-15 00:22:31 -0700",
"tests/library_checker_aizu_tests/handmade_tests/permutation_tree_small.test.cpp": "2024-12-14 15:47:13 -0600",
"tests/library_checker_aizu_tests/handmade_tests/permutation_tree_small.test.cpp": "2025-02-10 13:41:14 -0700",
"tests/library_checker_aizu_tests/handmade_tests/rmq_small_n.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/handmade_tests/sa_find_subarray.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/handmade_tests/seg_tree_find.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/handmade_tests/seg_tree_find_small.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/loops/chooses.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/loops/quotients.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/loops/submasks.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/loops/supermasks.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/math/binary_exponentiation_mod.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/math/binary_matrix_mult.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/math/count_paths.test.cpp": "2025-01-15 00:22:31 -0700",
Expand All @@ -95,32 +75,14 @@
"tests/library_checker_aizu_tests/math/mod_int_tetration.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/math/n_choose_k.test.cpp": "2025-01-15 00:22:31 -0700",
"tests/library_checker_aizu_tests/math/num_subsequences.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/math/partitions.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/math/prime_sieve.test.cpp": "2024-11-22 11:54:52 -0600",
"tests/library_checker_aizu_tests/math/solve_linear_mod.test.cpp": "2024-12-14 15:47:13 -0600",
"tests/library_checker_aizu_tests/math/tetration.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/math/totient.test.cpp": "2024-11-17 14:04:03 -0600",
"tests/library_checker_aizu_tests/math/xor_basis.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/math/xor_basis_intersection.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/monotonic_stack_related/cartesian_binary_tree.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/monotonic_stack_related/cartesian_k_ary_tree.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/monotonic_stack_related/count_rectangles.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/monotonic_stack_related/max_rect_histogram.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/strings/kmp.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/strings/lcp_array.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/strings/lcp_query_palindrome.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/strings/lcp_query_zfunc.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/strings/lcs_dp.test.cpp": "2024-12-05 10:41:42 -0600",
"tests/library_checker_aizu_tests/strings/lcs_queries.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/strings/lcs_queries.test.cpp": "2025-02-10 13:52:44 -0700",
"tests/library_checker_aizu_tests/strings/lcs_queries_merge_sort_tree.test.cpp": "2024-12-05 10:41:42 -0600",
"tests/library_checker_aizu_tests/strings/manacher.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/strings/multi_matching_bs.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/strings/prefix_function.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/strings/sa_cmp.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/strings/sa_sort_pairs.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/strings/single_matching_bs.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/strings/suffix_array.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/strings/suffix_array_short.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/strings/trie.test.cpp": "2024-12-05 10:41:42 -0600",
"tests/library_checker_aizu_tests/strings/wildcard_pattern_matching.test.cpp": "2024-12-14 19:50:29 -0600",
"tests/library_checker_aizu_tests/trees/count_paths_per_length.test.cpp": "2024-12-15 14:34:10 -0600",
Expand All @@ -129,9 +91,5 @@
"tests/library_checker_aizu_tests/trees/edge_cd_count_paths_per_length.test.cpp": "2024-12-15 17:01:11 -0600",
"tests/library_checker_aizu_tests/trees/edge_cd_reroot_dp.test.cpp": "2024-12-15 17:01:11 -0600",
"tests/library_checker_aizu_tests/trees/kth_path_ladder.test.cpp": "2024-12-15 14:34:10 -0600",
"tests/library_checker_aizu_tests/trees/kth_path_linear.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/trees/kth_path_tree_lift.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/trees/lca_all_methods_aizu.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/trees/lca_all_methods_lib_checker.test.cpp": "2025-02-10 14:50:36 -0700",
"tests/library_checker_aizu_tests/trees/subtree_isomorphism.test.cpp": "2024-12-15 14:34:10 -0600"
}
2 changes: 1 addition & 1 deletion library/data_structures/dsu/kruskal_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
struct kr_tree {
int id;
vi p;
vector<vi> adj;
vector<basic_string<int>> adj;
kr_tree(int n): id(n), p(2 * n, -1), adj(2 * n) {}
int find(int v) {
return p[v] < 0 ? v : p[v] = find(p[v]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
//! @time O((n + q) * \alpha(n))
//! @space O(n + q)
UF get_rp_dsu(const vector<array<int, 3>>& rests, int n) {
vector<vector<array<int, 2>>> rests_by_len(n + 1);
vector<basic_string<array<int, 2>>> rests_by_len(n + 1);
for (auto [l1, l2, len] : rests)
rests_by_len[len].push_back({l1, l2});
rests_by_len[len] += {l1, l2};
UF uf(n);
for (int len = n; len > 0; len--)
for (auto [l1, l2] : rests_by_len[len])
if (uf.join(l1, l2))
rests_by_len[len - 1].push_back({l1 + 1, l2 + 1});
rests_by_len[len - 1] += {l1 + 1, l2 + 1};
return uf;
}
6 changes: 2 additions & 4 deletions library/data_structures/seg_tree_uncommon/merge_sort_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
#include "../lazy_seg_tree_midpoint.hpp"
struct merge_sort_tree {
int n;
vector<vi> tree;
vector<basic_string<int>> tree;
merge_sort_tree(const vi& a): n(sz(a)), tree(2 * n) {
int pw2 = bit_ceil(size(a));
rep(i, 0, n) tree[(i + pw2) % n + n] = {a[i]};
for (int i = n - 1; i >= 1; i--) {
tree[i].resize(
sz(tree[2 * i]) + sz(tree[2 * i + 1]));
ranges::merge(tree[2 * i], tree[2 * i + 1],
begin(tree[i]));
back_inserter(tree[i]));
}
}
//! count of i in [l, r) such that a[i] in [vl, vr)
Expand Down
4 changes: 2 additions & 2 deletions library/data_structures/uncommon/mode_query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const int b = 318; //!< sqrt(1e5)
struct mode_query {
int n;
vi a, cnt, index_into_index;
vector<vi> index;
vector<basic_string<int>> index;
vector<vector<pii>>
mode_blocks; //!< {mode, cnt} of range of blocks
//! @param a compressed array: 0 <= a[i] < n
Expand All @@ -16,7 +16,7 @@ struct mode_query {
vector<pii>((n + b - 1) / b)) {
rep(i, 0, n) {
index_into_index[i] = sz(index[a[i]]);
index[a[i]].push_back(i);
index[a[i]] += i;
}
for (int start = 0; start < n; start += b) {
int mode = a[start];
Expand Down
8 changes: 4 additions & 4 deletions library/data_structures/uncommon/permutation_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ struct perm_tree {
};
vector<node> p;
int root;
vector<vi> ch;
vector<basic_string<int>> ch;
bool touches(int u, int v) {
return p[u].mn_num == p[v].mn_num + p[v].len ||
p[v].mn_num == p[u].mn_num + p[u].len;
}
int allocate(int mn_i, int mn_v, int ln, bool join,
const vi& chs) {
const basic_string<int>& chs) {
p.push_back({mn_i, mn_v, ln, join});
ch.push_back(chs);
return sz(ch) - 1;
Expand All @@ -50,7 +50,7 @@ struct perm_tree {
if (!empty(ch[u]) && touches(ch[u].back(), v)) {
p[u].mn_num = min(p[u].mn_num, p[v].mn_num);
p[u].len += p[v].len;
ch[u].push_back(v);
ch[u] += v;
v = u;
st.pop_back();
continue;
Expand All @@ -73,7 +73,7 @@ struct perm_tree {
break;
}
int min_num = p[v].mn_num;
vi chs(1 + sz(st) - idx, v);
basic_string<int> chs(1 + sz(st) - idx, v);
rep(j, idx, sz(st)) min_num =
min(min_num, p[chs[j - idx] = st[j][0]].mn_num);
v = allocate(l, min_num, i - l + 1, 0, chs);
Expand Down
13 changes: 6 additions & 7 deletions library/graphs/bridges_cuts/block_vertex_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
//! {
//! vector<vector<pii>> adj(n);
//! auto [num_bccs, bcc_id, is_cut] = cuts(adj, m);
//! vector<vi> bvt = block_vertex_tree(adj,
//! auto bvt = block_vertex_tree(adj,
//! num_bccs, bcc_id);
//! }
//! vector<basic_string<array<int, 2>>> adj(n);
//! auto [num_bccs, bcc_id, is_cut] = cuts(adj, m);
//! vector<vi> bvt = block_vertex_tree(adj,
//! num_bccs, bcc_id);
//! auto bvt = block_vertex_tree(adj, num_bccs, bcc_id);
//!
//! //to loop over each unique bcc containing a node u:
//! for (int bccid : bvt[v]) {
Expand All @@ -23,18 +22,18 @@
//! [n, n + num_bccs) are BCC nodes
//! @time O(n + m)
//! @time O(n)
vector<vi> block_vertex_tree(const auto& adj, int num_bccs,
auto block_vertex_tree(const auto& adj, int num_bccs,
const vi& bcc_id) {
int n = sz(adj);
vector<vi> bvt(n + num_bccs);
vector<basic_string<int>> bvt(n + num_bccs);
vector<bool> vis(num_bccs);
rep(i, 0, n) {
for (auto [_, e_id] : adj[i]) {
int bccid = bcc_id[e_id];
if (!vis[bccid]) {
vis[bccid] = 1;
bvt[i].push_back(bccid + n);
bvt[bccid + n].push_back(i);
bvt[i] += bccid + n;
bvt[bccid + n] += i;
}
}
for (int bccid : bvt[i]) vis[bccid - n] = 0;
Expand Down
13 changes: 5 additions & 8 deletions library/graphs/bridges_cuts/bridge_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@
//! {
//! vector<vector<pii>> adj(n);
//! auto [num_ccs, br_id, is_br] = bridges(adj, m);
//! vector<vi> bt = bridge_tree(adj,
//! num_ccs, br_id, is_br);
//! auto bt = bridge_tree(adj, num_ccs, br_id, is_br);
//! }
//! vector<basic_string<array<int, 2>>> adj(n);
//! auto [num_ccs, br_id, is_br] = bridges(adj, m);
//! vector<vi> bt = bridge_tree(adj,
//! num_ccs, br_id, is_br);
//! auto bt = bridge_tree(adj, num_ccs, br_id, is_br);
//! @endcode
//! @time O(n + m)
//! @space O(n)
vector<vi> bridge_tree(const auto& adj, int num_ccs,
auto bridge_tree(const auto& adj, int num_ccs,
const vi& br_id, const vi& is_br) {
vector<vi> tree(num_ccs);
vector<basic_string<int>> tree(num_ccs);
rep(i, 0, sz(adj)) for (auto [u, e_id] : adj[i]) if (
is_br[e_id]) tree[br_id[i]]
.push_back(br_id[u]);
is_br[e_id]) tree[br_id[i]] += br_id[u];
return tree;
}
4 changes: 2 additions & 2 deletions library/graphs/bridges_cuts/bridges.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
//! int u, v;
//! cin >> u >> v;
//! u--, v--;
//! adj[u].push_back({v, i});
//! adj[v].push_back({u, i});
//! adj[u] += {v, i};
//! adj[v] += {u, i};
//! }
//! auto [num_ccs, br_id, is_br] = bridges(adj, m);
//! @endcode
Expand Down
4 changes: 2 additions & 2 deletions library/graphs/bridges_cuts/cuts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
//! cin >> u >> v;
//! u--, v--;
//! //self edges not allowed
//! adj[u].push_back({v, i});
//! adj[v].push_back({u, i});
//! adj[u] += {v, i};
//! adj[v] += {u, i};
//! }
//! auto [num_bccs, bcc_id, is_cut] = cuts(adj, m);
//! @endcode
Expand Down
4 changes: 2 additions & 2 deletions library/graphs/enumerate_triangles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ void enumerate_triangles(const vector<pii>& edges, int n,
auto f) {
vi deg(n);
for (auto [u, v] : edges) deg[u]++, deg[v]++;
vector<vi> adj(n);
vector<basic_string<int>> adj(n);
for (auto [u, v] : edges) {
if (tie(deg[u], u) > tie(deg[v], v)) swap(u, v);
adj[u].push_back(v);
adj[u] += v;
}
vector<bool> seen(n);
for (auto [u, v] : edges) {
Expand Down
4 changes: 2 additions & 2 deletions library/graphs/functional_graph_processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
struct func_graph {
struct node {
pii root_of;
vi childs;
basic_string<int> childs;
};
vector<node> t;
vector<vi> cycle;
Expand All @@ -40,7 +40,7 @@ struct func_graph {
int v = i;
while (state[v] == 1) {
t[v].root_of = t[u].root_of;
t[a[v]].childs.push_back(v);
t[a[v]].childs += v;
state[v] = 2;
v = a[v];
}
Expand Down
2 changes: 1 addition & 1 deletion library/graphs/hopcroft_karp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! mvc_l, mvc_r] = hopcroft_karp(adj, rsz);
//! }
//! vector<basic_string<int>> adj(lsz);
//! adj[l].push_back(r); // add edge l <-> r
//! adj[l] += r; // add edge l <-> r
//! // 0<=l<lsz; 0<=r<rsz
//! auto [matching_size, to_r, to_l,
//! mvc_l, mvc_r] = hopcroft_karp(adj, rsz);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
//! @time O(n + m)
//! @space An O(n) edge list is allocated and returned, but
//! multiple O(n + m) vectors are allocated temporarily
vector<pii> extra_edges(const vector<vi>& adj,
int num_sccs, const vi& scc_id) {
vector<pii> extra_edges(const auto& adj, int num_sccs,
const vi& scc_id) {
if (num_sccs == 1) return {};
int n = sz(adj);
vector<vi> scc_adj(num_sccs);
vector<basic_string<int>> scc_adj(num_sccs);
vector<bool> zero_in(num_sccs, 1);
rep(i, 0, n) for (int u : adj[i]) {
if (scc_id[i] == scc_id[u]) continue;
scc_adj[scc_id[i]].push_back(scc_id[u]);
scc_adj[scc_id[i]] += scc_id[u];
zero_in[scc_id[u]] = 0;
}
vector<bool> vis(num_sccs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ vi offline_incremental_scc(vector<array<int, 2>> eds,
adj.emplace_back();
}
u = ids[u], v = ids[v];
if (*it <= mid) adj[u].push_back(v);
if (*it <= mid) adj[u] += v;
}
rep(i, 0, sz(adj)) ids[vs[i]] = -1;
scc_id = sccs(adj).second;
Expand Down
2 changes: 1 addition & 1 deletion library/math/matrix_related/xor_basis_unordered.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ template<class T> struct basis {
return v;
}
bool insert(T v) {
return (v = shrink(v)) ? b.push_back(v), 1 : 0;
return (v = shrink(v)) ? b += v, 1 : 0;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ template<class T>
basis<T> intersection(const basis<T>& u,
const basis<T>& v) {
basic_string<array<T, 2>> w;
for (T e : u.b) w.push_back({e, e});
for (T e : u.b) w += {e, e};
basis<T> res;
for (T e : v.b) {
T s = 0;
for (auto [x, y] : w)
if ((e ^ x) < e) e ^= x, s ^= y;
if (e) w.push_back({e, s});
if (e) w += {e, s};
else res.insert(s);
}
return res;
Expand Down
4 changes: 2 additions & 2 deletions library/strings/longest_common_subsequence/lcs_queries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
vi lcs_queries(const auto& s, const auto& t,
const vector<array<int, 3>>& queries) {
int n = sz(s), m = sz(t), q = sz(queries);
vector<vector<array<int, 3>>> qs(n);
vector<basic_string<array<int, 3>>> qs(n);
rep(i, 0, q) {
auto [s_r, t_le, t_ri] = queries[i];
if (s_r == 0 || t_le == m) continue;
qs[s_r - 1].push_back({t_le, t_ri, i});
qs[s_r - 1] += {t_le, t_ri, i};
}
lcs_dp lcs(t);
vi res(q);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct ladder {
//! @param adj forest (rooted or unrooted)
//! @time O(n log n)
//! @space O(n log n) for b_tbl. Everything else is O(n)
ladder(const vector<vi>& adj):
ladder(const auto& adj):
n(sz(adj)), d(n), p(n, -1), dl(n), idx_l(n) {
auto dfs = [&](auto&& self, int v) -> void {
dl[v] = v;
Expand Down
Loading
Loading