diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index a1d3bb7d..9869c803 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -50,10 +50,10 @@ "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/bcc_callback_aizu_bcc.test.cpp": "2025-06-25 15:06:18 -0600", -"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp": "2025-06-25 15:06:18 -0600", -"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp": "2025-06-25 15:06:18 -0600", -"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp": "2025-06-25 15:06:18 -0600", +"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp": "2025-07-08 18:30:57 -0600", +"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp": "2025-07-08 18:30:57 -0600", +"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp": "2025-07-08 18:30:57 -0600", +"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp": "2025-07-08 18:30:57 -0600", "tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp": "2025-02-10 23:30:47 -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", diff --git a/library/graphs/bridges_cuts/bcc_callback.hpp b/library/graphs/bridges_cuts/bcc_callback.hpp index f751b908..5fdaa396 100644 --- a/library/graphs/bridges_cuts/bcc_callback.hpp +++ b/library/graphs/bridges_cuts/bcc_callback.hpp @@ -27,6 +27,19 @@ //! bridge_tree[uf.find(i)] += uf.find(v); //! } //! +//! { +//! // ********* IF NO MULTIPLE EDGES ********* +//! vector adj(n); +//! vi cc_id(n); +//! bcc_callback(adj, [&](const vi& nodes) { +//! if (sz(nodes) == 2) { +//! // nodes[0] <=> nodes[1] is a bridge +//! return; +//! } +//! for (int v : nodes) cc_id[v] = nodes.back(); +//! }); +//! } +//! //! vector> adj(n); //! vector> block_vertex_tree(2 * n); //! int bcc_id = n; diff --git a/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp b/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp index 5b5ea3b5..bd22f849 100644 --- a/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp @@ -15,16 +15,8 @@ int main() { adj[v] += u; } vector bridges; - vector seen(n); bcc_callback(adj, [&](const vi& nodes) { - int count_edges = 0; - rep(i, 0, sz(nodes) - 1) { - seen[nodes[i]] = 1; - count_edges += ranges::count_if(adj[nodes[i]], - [&](int v) -> bool { return !seen[v]; }); - } - if (count_edges == 1) { - assert(sz(nodes) == 2); + if (sz(nodes) == 2) { pii bridge(nodes[0], nodes[1]); if (bridge.first > bridge.second) swap(bridge.first, bridge.second);