A fast 2048-element predecessor data structure

Правка en4, от yoshi_avx, 2026-05-25 18:07:08

This is my hand-unroll of the well known (?) 64-ary tree, or, "bitset" tree used for predecessor problems. I tried to squeeze a pretty rudimentary implementation of 200A - Cinema in $$$O(k \sqrt{k} \log_W(n))$$$ using my usual bitset tree template, but it fell pretty short (1.7s). Rewriting made it go down to just 0.6s, which is seen in these two submissions: 376029723, 376055924.

Code

This can probably beat the DSU implementation suggested (technically not in TC, since they treat $$$O(\alpha(n))$$$ as $$$O(1)$$$). At least it uses much lower memory.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский yoshi_avx 2026-05-25 18:07:08 4 Tiny change: '0A] in $O(n \sqrt{n} \log_W(n' -> '0A] in $O(k \sqrt{k} \log_W(n'
en3 Английский yoshi_avx 2026-05-25 18:03:06 88
en2 Английский yoshi_avx 2026-05-25 18:01:48 123
en1 Английский yoshi_avx 2026-05-25 18:01:01 2058 Initial revision (published)