We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6f18ed commit 35a0aafCopy full SHA for 35a0aaf
library/trees/uncommon/linear_kth_par.hpp
@@ -41,8 +41,8 @@ template<int KAPPA = 2> struct linear_kth_par {
41
int kth_par(int u, int k) {
42
assert(0 <= k && k <= d[u]);
43
int anc_d = d[u] - k;
44
- if (unsigned j = k / (KAPPA + 1); j)
45
- j = bit_floor(j), u = jmp[(pos[u] & -j) | j];
+ if (int j = bit_floor(k / (KAPPA + 1u)))
+ u = jmp[(pos[u] & -j) | j];
46
return u = leaf[u], lad[u][d[u] - anc_d];
47
}
48
};
0 commit comments