MCPcopy Create free account
hub / github.com/atcoder/ac-library / scc

Method scc

atcoder/internal_scc.hpp:62–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 }
61
62 std::vector<std::vector<int>> scc() {
63 auto ids = scc_ids();
64 int group_num = ids.first;
65 std::vector<int> counts(group_num);
66 for (auto x : ids.second) counts[x]++;
67 std::vector<std::vector<int>> groups(ids.first);
68 for (int i = 0; i < group_num; i++) {
69 groups[i].reserve(counts[i]);
70 }
71 for (int i = 0; i < _n; i++) {
72 groups[ids.second[i]].push_back(i);
73 }
74 return groups;
75 }
76
77 private:
78 int _n;

Callers

nothing calls this directly

Calls 1

reserveMethod · 0.80

Tested by

no test coverage detected