Skip to content

Commit 35a0aaf

Browse files
committed
another golf
1 parent b6f18ed commit 35a0aaf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/trees/uncommon/linear_kth_par.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ template<int KAPPA = 2> struct linear_kth_par {
4141
int kth_par(int u, int k) {
4242
assert(0 <= k && k <= d[u]);
4343
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];
44+
if (int j = bit_floor(k / (KAPPA + 1u)))
45+
u = jmp[(pos[u] & -j) | j];
4646
return u = leaf[u], lad[u][d[u] - anc_d];
4747
}
4848
};

0 commit comments

Comments
 (0)