Skip to content

Commit ffd205e

Browse files
committed
convert back to vector
1 parent 7fc068f commit ffd205e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

library/trees/ladder_decomposition/linear_kth_par.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
template<int KAPPA = 3> struct linear_kth_par {
1616
int n;
1717
vi d, leaf, pos, jmp;
18-
vector<basic_string<int>> lad;
18+
vector<vi> lad;
1919
linear_kth_par(const auto& adj):
2020
n(sz(adj)), d(n), leaf(n), pos(n), jmp(2 * n), lad(n) {
2121
static_assert(KAPPA >= 2);
@@ -42,7 +42,7 @@ template<int KAPPA = 3> struct linear_kth_par {
4242
len = max(len, 2 * (KAPPA - 1));
4343
int i = d[leaf[v]] - sz(lad[leaf[v]]);
4444
while (i && sz(lad[leaf[v]]) < len)
45-
lad[leaf[v]] += st[i--];
45+
lad[leaf[v]].push_back(st[i--]);
4646
assert(lad[leaf[v]].back() > 0);
4747
};
4848
dfs(dfs, 0, 0);
@@ -52,8 +52,6 @@ template<int KAPPA = 3> struct linear_kth_par {
5252
int j = v;
5353
if (unsigned b = k / KAPPA; b)
5454
b = bit_floor(b), j = jmp[(pos[v] & -b) | b];
55-
// TODO array index out of bounds goes uncaught here
56-
// because of basic_string
5755
return j = leaf[j], lad[j][k + d[j] - d[v]];
5856
}
5957
};

0 commit comments

Comments
 (0)