Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • $\begingroup$ For Your array $a$, you want to count the index pairs, $(i,j)$ for which $(a_i \operatorname{xor} a_j) = k$, is that correct? $\endgroup$ Commented Aug 17, 2023 at 8:23
  • $\begingroup$ @DirkT yes, for each query. $\endgroup$ Commented Aug 17, 2023 at 9:46
  • 2
    $\begingroup$ en.wikipedia.org/wiki/Discrete_Fourier_transform_over_a_ring, en.wikipedia.org/wiki/Cyclotomic_fast_Fourier_transform $\endgroup$ Commented Aug 17, 2023 at 16:14
  • $\begingroup$ The xor is in the exponent, not the coefficients, so I don't see how FFT could be useful $\endgroup$ Commented Aug 20, 2023 at 11:31