shaaban_abdelrahim's blog

By shaaban_abdelrahim, history, 6 months ago, In English

What is the best B to use in 3D/4D MO?

»
6 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

The time complexity of k-dimensional Mo's is $$$O(q * B + (n/B)^{k-1}n)$$$ (assuming $$$k$$$ is a constant). Choosing $$$B = O(n / q^{1/k})$$$ gives a time complexity of $$$n \cdot q^{1-1/k}$$$. See https://mirror.codeforces.com/blog/entry/61203?#comment-451304 for more information and proof of the $$$n \cdot q^{1-1/k}$$$ lower bound.

»
6 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

If you do 4d mo, just write a quadratic solution with good constant factor, and it will be faster