Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions .verify-helper/timestamps.remote.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@
"tests/library_checker_aizu_tests/trees/edge_cd_count_paths_per_length.test.cpp": "2025-08-06 13:48:07 -0600",
"tests/library_checker_aizu_tests/trees/edge_cd_reroot_dp.test.cpp": "2025-04-27 21:47:37 -0600",
"tests/library_checker_aizu_tests/trees/kth_path_ladder.test.cpp": "2025-08-06 12:42:13 -0600",
"tests/library_checker_aizu_tests/trees/kth_path_linear.test.cpp": "2025-08-06 12:42:13 -0600",
"tests/library_checker_aizu_tests/trees/kth_path_tree_lift.test.cpp": "2025-08-06 12:42:13 -0600",
"tests/library_checker_aizu_tests/trees/lca_all_methods_aizu.test.cpp": "2025-08-06 12:42:13 -0600",
"tests/library_checker_aizu_tests/trees/lca_all_methods_lib_checker.test.cpp": "2025-08-06 12:42:13 -0600",
"tests/library_checker_aizu_tests/trees/subtree_isomorphism.test.cpp": "2025-08-06 12:42:13 -0600"
}
4 changes: 0 additions & 4 deletions library/graphs/dijkstra.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#pragma once
//! @code
//! {
//! vector<vector<pair<int, ll>>> adj(n);
//! auto d = dijkstra(adj, source);
//! }
//! vector<basic_string<array<int, 2>>> adj(n);
//! auto d = dijkstra(adj, source);
//! @endcode
Expand Down
7 changes: 1 addition & 6 deletions library/graphs/hopcroft_karp.hpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
#pragma once
//! https://github.com/foreverbell/acm-icpc-cheat-sheet/blob/master/src/graph-algorithm/hopcroft-karp.cpp
//! @code
//! {
//! vector<vi> adj(lsz);
//! auto [matching_size, to_r, to_l,
//! mvc_l, mvc_r] = hopcroft_karp(adj, rsz);
//! }
//! vector<basic_string<int>> adj(lsz);
//! adj[l] += r; // add edge l <-> r
//! // 0<=l<lsz; 0<=r<rsz
//! // 0<=l<lsz; 0<=r<rsz
//! auto [matching_size, to_r, to_l,
//! mvc_l, mvc_r] = hopcroft_karp(adj, rsz);
//! @endcode
Expand Down
4 changes: 0 additions & 4 deletions library/graphs/scc.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#pragma once
//! https://github.com/kth-competitive-programming/kactl/blob/main/content/graph/SCC.h
//! @code
//! {
//! vector<vi> adj(n);
//! auto [num_sccs, scc_id] = sccs(adj);
//! }
//! vector<basic_string<int>> adj(n);
//! auto [num_sccs, scc_id] = sccs(adj);
//! @endcode
Expand Down
6 changes: 0 additions & 6 deletions library/graphs/uncommon/block_vertex_tree.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#pragma once
#include "cuts.hpp"
//! @code
//! {
//! vector<vector<pii>> adj(n);
//! auto [num_bccs, bcc_id, is_cut] = cuts(adj, m);
//! 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);
//! auto bvt = block_vertex_tree(adj, num_bccs, bcc_id);
Expand Down
5 changes: 0 additions & 5 deletions library/graphs/uncommon/bridge_tree.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#pragma once
#include "bridges.hpp"
//! @code
//! {
//! vector<vector<pii>> adj(n);
//! auto [num_ccs, br_id, is_br] = bridges(adj, m);
//! 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);
//! auto bt = bridge_tree(adj, num_ccs, br_id, is_br);
Expand Down
4 changes: 0 additions & 4 deletions library/graphs/uncommon/bridges.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#pragma once
//! https://cp-algorithms.com/graph/bridge-searching.html
//! @code
//! {
//! vector<vector<pii>> adj(n);
//! auto [num_ccs, br_id, is_br] = bridges(adj, m);
//! }
//! vector<basic_string<array<int, 2>>> adj(n);
//! rep (i, 0, m) {
//! int u, v;
Expand Down
4 changes: 0 additions & 4 deletions library/graphs/uncommon/complement_graph_ccs.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#pragma once
//! @code
//! {
//! vector<vi> adj(n);
//! vi cc_id = get_complement_graph_ccs(adj);
//! }
//! vector<basic_string<int>> adj;
//! vi cc_id = get_complement_graph_ccs(adj);
//! @endcode
Expand Down
4 changes: 0 additions & 4 deletions library/graphs/uncommon/cuts.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#pragma once
//! https://cp-algorithms.com/graph/cutpoints.html
//! @code
//! {
//! vector<vector<pii>> adj(n);
//! auto [num_bccs, bcc_id, is_cut] = cuts(adj, m);
//! }
//! vector<basic_string<array<int, 2>>> adj(n);
//! rep (i, 0, m) {
//! int u, v;
Expand Down
6 changes: 0 additions & 6 deletions library/trees/centroid_decomp.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#pragma once
//! @code
//! {
//! vector<vi> adj(n);
//! centroid(adj, [&](const auto& adj,
//! int cent, int par_cent) {
//! });
//! }
//! vector<basic_string<int>> adj(n);
//! centroid(adj, [&](const auto& adj,
//! int cent, int par_cent) {});
Expand Down
5 changes: 0 additions & 5 deletions library/trees/edge_cd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
//! https://codeforces.com/blog/entry/142176
//! https://youtu.be/wDwaMo5xa-k
//! @code
//! {
//! vector<vi> adj(n);
//! edge_cd(adj, [&](const auto& adj,
//! int cent, int m) {});
//! }
//! vector<basic_string<int>> adj(n);
//! edge_cd(adj, [&](const auto& adj, int cent, int m) {
//! // subtrees of [0, m) of adj[cent]: 1st edge-set
Expand Down
4 changes: 0 additions & 4 deletions library/trees/lca_rmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
#include "../data_structures/rmq.hpp"
//! https://github.com/kth-competitive-programming/kactl/blob/main/content/graph/LCA.h
//! @code
//! {
//! vector<vi> adj(n);
//! LCA lca(adj);
//! }
//! vector<basic_string<int>> adj(n);
//! LCA lca(adj);
//! @endcode
Expand Down
4 changes: 0 additions & 4 deletions library/trees/linear_kth_par.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#pragma once
//! https://codeforces.com/blog/entry/126580
//! @code
//! {
//! vector<vi> adj(n);
//! linear_kth_par kp(adj);
//! }
//! vector<basic_string<int>> adj(n);
//! linear_kth_par kp(adj);
//! kp.kth_par(v, k); // k edges up from v
Expand Down
4 changes: 0 additions & 4 deletions library/trees/linear_lca.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#pragma once
//! https://codeforces.com/blog/entry/125371
//! @code
//! {
//! vector<vi> adj(n);
//! linear_lca llca(adj);
//! }
//! vector<basic_string<int>> adj(n);
//! linear_lca llca(adj);
//! @endcode
Expand Down
5 changes: 1 addition & 4 deletions library/trees/tree_lift.hpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#pragma once
//! https://github.com/ucf-programming-team/hackpack-cpp/blob/master/content/graphs/TreeLifting.h
//! @code
//! {
//! vector<vi> adj(n);
//! tree_lift tree_l(adj);
//! }
//! vector<basic_string<int>> adj(n);
//! tree_lift tree_l(adj);
//! tree_l.kth_par(v, k); // k edges up from v
//! tree_l.kth_par(v, 1); // v's parent
//! @endcode
//! @time O(n + q log n)
//! @space O(n)
Expand Down
5 changes: 0 additions & 5 deletions library/trees/uncommon/subtree_isomorphism.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#pragma once
//! @code
//! {
//! vector<vi> adj(n);
//! auto [num_distinct_subtrees, iso_id] =
//! subtree_iso(adj);
//! }
//! vector<basic_string<int>> adj(n);
//! auto [num_distinct_subtrees, iso_id] =
//! subtree_iso(adj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ int main() {
cin.tie(0)->sync_with_stdio(0);
int n, m;
cin >> n >> m;
vector<basic_string<int>> adj(n);
for (int i = 0; i < n; i++) adj[i] += i;
vector<vector<int>> adj(n);
for (int i = 0; i < n; i++) adj[i].push_back(i);
for (int i = 0; i < m; i++) {
int u, v;
cin >> u >> v;
adj[u] += v;
adj[v] += u;
adj[u].push_back(v);
adj[v].push_back(u);
}
vi cnt(n);
bcc_callback(adj, [&](const vi& nodes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ int main() {
cin.tie(0)->sync_with_stdio(0);
int n, m;
cin >> n >> m;
vector<basic_string<int>> adj(n);
for (int i = 0; i < n; i++) adj[i] += i;
vector<vi> adj(n);
for (int i = 0; i < n; i++) adj[i].push_back(i);
for (int i = 0; i < m; i++) {
int u, v;
cin >> u >> v;
adj[u] += v;
adj[v] += u;
adj[u].push_back(v);
adj[v].push_back(u);
}
vector<pii> bridges;
bcc_callback(adj, [&](const vi& nodes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ int main() {
cin.tie(0)->sync_with_stdio(0);
int n, m;
cin >> n >> m;
vector<basic_string<int>> adj(n);
for (int i = 0; i < n; i++) adj[i] += i;
vector<vector<int>> adj(n);
for (int i = 0; i < n; i++) adj[i].push_back(i);
for (int i = 0; i < m; i++) {
int u, v;
cin >> u >> v;
adj[u] += v;
adj[v] += u;
adj[u].push_back(v);
adj[v].push_back(u);
}
vector<bool> vis(n, 0);
vector<vector<int>> all_bccs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ int main() {
cin.tie(0)->sync_with_stdio(0);
int n, m;
cin >> n >> m;
vector<basic_string<int>> adj(n);
vector<vi> adj(n);
for (int i = 0; i < m; i++) {
int u, v;
cin >> u >> v;
adj[u] += v;
adj[v] += u;
adj[u].push_back(v);
adj[v].push_back(u);
}
UF uf(n);
vector<bool> seen(n);
Expand All @@ -30,8 +30,8 @@ int main() {
}
for (int v : nodes) uf.join(v, nodes[0]);
});
vector<basic_string<int>> two_edge_ccs(n);
rep(i, 0, n) two_edge_ccs[uf.find(i)] += i;
vector<vi> two_edge_ccs(n);
rep(i, 0, n) two_edge_ccs[uf.find(i)].push_back(i);
int cnt_ccs = 0;
rep(i, 0, n) cnt_ccs += (!empty(two_edge_ccs[i]));
cout << cnt_ccs << '\n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int main() {
cin >> a[i];
res[i] = a[i];
}
vector<basic_string<int>> adj(n);
vector<vi> adj(n);
vector<mint> b(n - 1), c(n - 1);
vector<pair<int, int>> par(n, {-1, -1});
vector<vector<int>> base_adj(n);
Expand Down Expand Up @@ -47,7 +47,7 @@ int main() {
};
{ edge_cd(base_adj, edge_cd_asserts); }
edge_cd(adj,
[&](const vector<basic_string<int>>& cd_adj, int cent,
[&](const vector<vi>& cd_adj, int cent,
int split) -> void {
array<vector<array<mint, 3>>, 2> all_backwards;
array<mint, 2> sum_forward = {0, 0};
Expand Down
3 changes: 3 additions & 0 deletions tests/scripts/grep_clangformat_cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ grep "ssize" --recursive ../library/ && exit 1
echo "check vi instead of vector<int>"
grep "vector<int>" --recursive ../library/**/*.hpp && exit 1

echo "check no basic_string, excluding @code example inits"
grep "[[:space:]]*//\!" --recursive --invert-match ../library/**/*.hpp library_checker_aizu_tests/**/*.test.cpp | grep "basic_string" && exit 1

echo "check begin(arr) instead of arr.begin(), similarly for end, rbegin, rend, empty, size:"
# TODO: remove this define filter if/when we move to -std=c++20
grep --invert-match --fixed-strings "#define" --recursive ../library/ library_checker_aizu_tests/ |
Expand Down
Loading