Language: C++

#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
typedef complex<double> base;
vector<base> omega;
int FFT_N , mod = 1e18;
void init_fft(int n)
{
  FFT_N  = n;
  omega.resize(n);
  double angle = 2 * PI / n;
  for(int i = 0; i < n; i++)
    omega[i] = base( cos(i * angle), sin(i * angle));
}
void fft (vector<base> & a)
{
  int n = (int) a.size();
  if (n == 1)  return;
  int half = n >> 1;
  vector<base> even (half),  odd (half);
  for (int i=0, j=0; i<n; i+=2, ++j)
    {
      even[j] = a[i];
      odd[j] = a[i+1];
    }
  fft (even), fft (odd);
  for (int i=0, fact = FFT_N/n; i < half; ++i)
    {
      base twiddle =  odd[i] * omega[i * fact] ;
      a[i] =  even[i] + twiddle;
      a[i+half] = even[i] - twiddle;
    }
}
void multiply (const vector<int> & a, const vector<int> & b, vector<int> & res)
{
  vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
  int n = 1;
  while (n < 2*max (a.size(), b.size()))  n <<= 1;
  fa.resize (n),  fb.resize (n);

  init_fft(n);
  fft (fa),  fft (fb);
  for (size_t i=0; i<n; ++i)
    fa[i] = conj( fa[i] * fb[i]);
  fft (fa);
  res.resize (n);
  for (size_t i=0; i<n; ++i)
    {
      res[i] = (int) (fa[i].real() / n + 0.5);
    }
}
int ans[400005][33];
int arr[200005];
int brr[400005];
int crr[400005];
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    for(int i=0;i<n;i++)cin>>arr[i];
    for(int i=0;i<n;i++)cin>>crr[i];
    for(int i=n-1;i>=0;i--)brr[i+n] = brr[i] = crr[n-1-i];
    for(int j=0;j<20;j++){
       for(int i=0;i<n;i++){
            if(arr[i]&(1<<j))a.push_back(-1);
            else a.push_back(1);
        }
        for(int i=0;i<n+n-1;i++){
            if(brr[i]&(1<<j))b.push_back(-1);
            else b.push_back(1);
        }
        multiply(a,b,c);
        for(int i=0;i<n;i++){
            if(c[i+n-1]==n)ans[i][j] = 1;
            if(c[i+n-1]==-n+1)ans[i][j] = 1;
        }
        /*
        for(long long &x:b)x*=-1;
        multiply(a,b,c);
        for(int i=0;i<n;i++){
            if(c[i+n-1]==n)ans[i][j] = 1;
        }
        */
    }
    for(int i=0;i<n;i++){
        int cnt = 1;
        for(int j=0;j<31;j++){
            if(ans[i][j]==0){
                cnt = 0;
            }
        }
        if(cnt){
            cout<<i<<" "<<(crr[0]^arr[i])<<endl;

        }
    }
    return 0;
}


Compiler output:
a.cc:6:19: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
    6 | int FFT_N , mod = 1e18;
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:65:30: error: 'a' was not declared in this scope
   65 |             if(arr[i]&(1<<j))a.push_back(-1);
      |                              ^
a.cc:66:18: error: 'a' was not declared in this scope
   66 |             else a.push_back(1);
      |                  ^
a.cc:69:30: error: 'b' was not declared in this scope
   69 |             if(brr[i]&(1<<j))b.push_back(-1);
      |                              ^
a.cc:70:18: error: 'b' was not declared in this scope
   70 |             else b.push_back(1);
      |                  ^
a.cc:72:18: error: 'a' was not declared in this scope
   72 |         multiply(a,b,c);
      |                  ^
a.cc:72:20: error: 'b' was not declared in this scope
   72 |         multiply(a,b,c);
      |                    ^
a.cc:72:22: error: 'c' was not declared in this scope
   72 |         multiply(a,b,c);
      |                      ^