Language: C++

#include <cstdio>
#include <algorithm>
#include <ctype.h>
#include <smmintrin.h>

using namespace std;

#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)

#define __my_getchar getchar_unlocked
inline void read(int &x){
  x=0;char c;
  while(!isdigit(c=__my_getchar()));
  x=c-'0';
  while(isdigit(c=__my_getchar()))x=10*x+(c-'0');
}

#define AL16 __attribute__((aligned(16)))

// #define RANDOM_TEST
#define RANDOM_N 199999

// #define READ_A_LATER

#define N 200000

#define B 1600
#define BSZ (N / B)

int n;
#ifndef READ_A_LATER
int a[202521] AL16;
#endif
int b[202521] AL16;
int tmp[4] AL16;

int aa[B] AL16;

int main(){
  #ifndef RANDOM_TEST
  scanf("%d",&n);
  // REP(i,n)scanf("%d",b+i);
  REP(i,n)read(b[i]);
  #else
  n = RANDOM_N;
  REP(i,n)b[i]=rand();
  #endif

  assert(n>2);

  #ifndef READ_A_LATER
  #ifndef RANDOM_TEST
  // REP(i,n)scanf("%d",a+i);
  REP(i,n)read(a[i]);
  #else
  REP(i,n)a[i]=rand();
  #endif
  #endif

  int ans = 0;
  REP(ii,BSZ){
    if(ii*B >= n)break;
    const int eee = n/B==ii ? (n - (n/B)*B) : B;
    __m128i xors = _mm_setzero_si128();
    #ifdef READ_A_LATER
    REP(i,B)aa[i] = 0;
    REP(i,eee){
      #ifndef RANDOM_TEST
      // scanf("%d",aa+i);
      read(aa[i]);
      #else
      aa[i] = rand();
      #endif
      if(n%2==1)ans ^= aa[i];
    }
    #else
    REP(i,B/32){
      _mm_store_si128((__m128i*)(aa+32*i+0x00), _mm_load_si128((__m128i*)(a+B*ii+32*i+0x00)));
      _mm_store_si128((__m128i*)(aa+32*i+0x04), _mm_load_si128((__m128i*)(a+B*ii+32*i+0x04)));
      _mm_store_si128((__m128i*)(aa+32*i+0x08), _mm_load_si128((__m128i*)(a+B*ii+32*i+0x08)));
      _mm_store_si128((__m128i*)(aa+32*i+0x0c), _mm_load_si128((__m128i*)(a+B*ii+32*i+0x0c)));
      _mm_store_si128((__m128i*)(aa+32*i+0x10), _mm_load_si128((__m128i*)(a+B*ii+32*i+0x10)));
      _mm_store_si128((__m128i*)(aa+32*i+0x14), _mm_load_si128((__m128i*)(a+B*ii+32*i+0x14)));
      _mm_store_si128((__m128i*)(aa+32*i+0x18), _mm_load_si128((__m128i*)(a+B*ii+32*i+0x18)));
      _mm_store_si128((__m128i*)(aa+32*i+0x1c), _mm_load_si128((__m128i*)(a+B*ii+32*i+0x1c)));
    }
    if(n%2==1){
      REP(i,B/32){
        xors = _mm_xor_si128(xors, _mm_load_si128((__m128i*)(a+B*ii+32*i+0x00)));
        xors = _mm_xor_si128(xors, _mm_load_si128((__m128i*)(a+B*ii+32*i+0x04)));
        xors = _mm_xor_si128(xors, _mm_load_si128((__m128i*)(a+B*ii+32*i+0x08)));
        xors = _mm_xor_si128(xors, _mm_load_si128((__m128i*)(a+B*ii+32*i+0x0c)));
        xors = _mm_xor_si128(xors, _mm_load_si128((__m128i*)(a+B*ii+32*i+0x10)));
        xors = _mm_xor_si128(xors, _mm_load_si128((__m128i*)(a+B*ii+32*i+0x14)));
        xors = _mm_xor_si128(xors, _mm_load_si128((__m128i*)(a+B*ii+32*i+0x18)));
        xors = _mm_xor_si128(xors, _mm_load_si128((__m128i*)(a+B*ii+32*i+0x1c)));
      }
    }
    #endif
    REP(jj,BSZ){
      REP(i,eee){
        __m128i aaaa = _mm_set1_epi32(aa[i]);
        __m128i *it = (__m128i*)(b + B*jj), *end = (__m128i*)(b + B*jj + B);
        while(it != end){
          __m128i bbbb;
          
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
          bbbb = _mm_load_si128(it++); bbbb = _mm_add_epi32(bbbb, aaaa); xors = _mm_xor_si128(xors, bbbb);
        }
      }
    }
    _mm_store_si128((__m128i*)tmp, xors);
    REP(i,4)ans ^= tmp[i];
  }
  printf("%d\n", ans);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:3: error: 'assert' was not declared in this scope
   50 |   assert(n>2);
      |   ^~~~~~
a.cc:5:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    4 | #include <smmintrin.h>
  +++ |+#include <cassert>
    5 |