Skip to content

Commit 5eef2d6

Browse files
committed
convert another one to basic string
1 parent 3f655a2 commit 5eef2d6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

library/data_structures/dsu/range_parallel_equivalence_classes.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
//! @time O((n + q) * \alpha(n))
66
//! @space O(n + q)
77
UF get_rp_dsu(const vector<array<int, 3>>& rests, int n) {
8-
vector<vector<array<int, 2>>> rests_by_len(n + 1);
9-
for (auto [l1, l2, len] : rests)
10-
rests_by_len[len].push_back({l1, l2});
8+
vector<basic_string<array<int, 2>>> rests_by_len(n + 1);
9+
for (auto [l1, l2, len] : rests) rests_by_len[len] += {l1, l2};
1110
UF uf(n);
1211
for (int len = n; len > 0; len--)
1312
for (auto [l1, l2] : rests_by_len[len])
14-
if (uf.join(l1, l2))
15-
rests_by_len[len - 1].push_back({l1 + 1, l2 + 1});
13+
if (uf.join(l1, l2)) rests_by_len[len - 1] += {l1 + 1, l2 + 1};
1614
return uf;
1715
}

0 commit comments

Comments
 (0)