Skip to content

Commit 68b7147

Browse files
committed
another one
1 parent 3647c74 commit 68b7147

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

library/graphs/bridges_cuts/block_vertex_tree.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! }
1010
//! vector<basic_string<array<int, 2>>> adj(n);
1111
//! auto [num_bccs, bcc_id, is_cut] = cuts(adj, m);
12-
//! vector<vi> bvt = block_vertex_tree(adj,
12+
//! auto bvt = block_vertex_tree(adj,
1313
//! num_bccs, bcc_id);
1414
//!
1515
//! //to loop over each unique bcc containing a node u:
@@ -23,18 +23,18 @@
2323
//! [n, n + num_bccs) are BCC nodes
2424
//! @time O(n + m)
2525
//! @time O(n)
26-
vector<vi> block_vertex_tree(const auto& adj, int num_bccs,
26+
auto block_vertex_tree(const auto& adj, int num_bccs,
2727
const vi& bcc_id) {
2828
int n = sz(adj);
29-
vector<vi> bvt(n + num_bccs);
29+
vector<basic_string<int>> bvt(n + num_bccs);
3030
vector<bool> vis(num_bccs);
3131
rep(i, 0, n) {
3232
for (auto [_, e_id] : adj[i]) {
3333
int bccid = bcc_id[e_id];
3434
if (!vis[bccid]) {
3535
vis[bccid] = 1;
36-
bvt[i].push_back(bccid + n);
37-
bvt[bccid + n].push_back(i);
36+
bvt[i] += bccid + n;
37+
bvt[bccid + n] += i;
3838
}
3939
}
4040
for (int bccid : bvt[i]) vis[bccid - n] = 0;

tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ int main() {
1616
edges[i] = make_pair(u, v);
1717
}
1818
auto [num_bccs, bcc_id, is_cut] = cuts(adj, m);
19-
vector<vector<int>> bvt =
20-
block_vertex_tree(adj, num_bccs, bcc_id);
19+
auto bvt = block_vertex_tree(adj, num_bccs, bcc_id);
2120
assert(
2221
find(begin(bcc_id), end(bcc_id), -1) == end(bcc_id));
2322
for (int i = 0; i < n; i++) {

0 commit comments

Comments
 (0)