Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lrvideckis committed Nov 27, 2024
1 parent 9902888 commit b127c2a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ struct functional_graph_processor {
vector<int> was, was2;
void build(const vector<int> &next) {
cycle.clear();
fill(cycle_id.begin(), cycle_id.end(), -1);
fill(cycle_pos.begin(), cycle_pos.end(), -1);
fill(cycle_prev.begin(), cycle_prev.end(), -1);
fill(all(cycle_id), -1);
fill(all(cycle_pos), -1);
fill(all(cycle_prev), -1);
++attempt;
for (auto u = 0; u < n; ++u) {
if (was[u] == attempt) continue;
Expand Down Expand Up @@ -75,7 +75,7 @@ struct functional_graph_processor {
}
for (auto u = 0; u < n; ++u)
if (~cycle_pos[u]) cycle_prev[next[u]] = u;
for (auto c : cycle) {
for (const auto &c : cycle) {
auto dfs = [&](auto self, int u) -> void {
size[u] = 1;
pos[u] = (int)order.size();
Expand Down

0 comments on commit b127c2a

Please sign in to comment.