Skip to content

Commit c214314

Browse files
committed
remove var
1 parent 2d56da5 commit c214314

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

library/graphs/strongly_connected_components/offline_incremental_scc.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ vi offline_incremental_scc(vector<array<int, 2>> eds,
1818
vector<vi> adj;
1919
auto divide_and_conquer = [&](auto&& self, auto el,
2020
auto er, int tl, int tr) {
21-
int mid = midpoint(tl, tr), p = 0;
21+
adj.clear();
22+
int mid = midpoint(tl, tr);
2223
for (auto it = el; it != er; it++) {
2324
auto& [u, v] = eds[*it];
2425
for (int w : {u, v}) {
2526
if (ids[w] != -1) continue;
26-
ids[w] = p;
27-
vs[p++] = w;
27+
ids[w] = sz(adj);
28+
vs[sz(adj)] = w;
2829
adj.emplace_back();
2930
}
3031
u = ids[u], v = ids[v];
3132
if (*it <= mid) adj[u].push_back(v);
3233
}
33-
rep(i, 0, p) ids[vs[i]] = -1;
34+
rep(i, 0, sz(adj)) ids[vs[i]] = -1;
3435
scc_id = sccs(adj).scc_id;
35-
adj.clear();
3636
auto split = partition(el, er, [&](int i) {
3737
return scc_id[eds[i][0]] == scc_id[eds[i][1]];
3838
});

0 commit comments

Comments
 (0)