Language: C++

#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <cstring>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

using namespace std;
using lint = long long;

#pragma GCC optimize ("Ofast", "unroll-loops")
#pragma GCC target ("arch=ivybridge")

constexpr int nmax = 204800, block = 4096, unrl = 16;
int a[nmax], b[nmax];

//// FastIn from rsk0315
namespace FastIn {
  static constexpr size_t BUF_SIZE=1<<10, INT_LEN=24, FLT_LEN=400;
  static char buf[BUF_SIZE|1]={}, *pos=buf, *endbuf=nullptr;
  FILE *fin;
 
  inline bool rebuffer() {
    // returns true <=> there is at least one unread character
    size_t rest=endbuf-pos;
    if (buf+rest > pos) {
      // buf[:pos] and buf[-pos:] are overlapping, which std::memcpy()
      // causes undefined behavior.
      return true;
    }
 
    std::memcpy(buf, pos, rest); 
    pos = buf;
    size_t len=std::fread(pos+rest, 1, BUF_SIZE-rest, fin);
    *(endbuf = buf + (rest+len)) = 0;
 
    return *pos;
  }
 
  template <class Int>
  inline bool scan(Int &in) {
    in = 0;
 
    // assume that no redundant whitespace appears
    if (pos + INT_LEN >= endbuf && !rebuffer()) {
      return false;
    }
 
    if (std::is_signed<Int>::value) {
      if (*pos == '-') {
        in = ~*++pos+'1';
        while (*++pos >= '0') {
          in = in*10 + ~*pos+'1';
        }
        ++pos;
        return true;
      }
    }
 
    // assume that numbers are separated by the character whose value is
    // less than '0' (e.g. whitespaces, newlines)
    do {
      in = in*10 + *pos-'0';
    } while (*++pos >= '0');
    ++pos;
    return true;
  }
 
  class Scanner {
    bool rebuffer() {
      return FastIn::rebuffer();
    }
 
  public:
    Scanner(FILE *fin=stdin) {
      FastIn::fin = fin;
      endbuf = pos + std::fread(buf, 1, BUF_SIZE, fin);
    }
 
    template <class T>
    inline bool scan(T &in) {
      return FastIn::scan(in);
    }
 
    template <class First, class... Rest>
    inline bool scan(First &in, Rest &...ins) {
      return scan(in) && scan(ins...);
    }
  };
}
 
FastIn::Scanner cin;

int main() {

	int N;
	N = cin.scan();
	for (int i = 0; i < N; i++) a[i] = cin.scan();
	for (int i = 0; i < N; i++) b[i] = cin.scan();

	int ans = 0;
	for (int i = 0; i + unrl <= N; i += unrl) {
		for (int j = 0; j + block <= N; j += block) {
			for (int k = j; k < block + j; k++) {

				ans ^= (a[i + 0] + b[k]) ^ (a[i + 1] + b[k]);
				ans ^= (a[i + 2] + b[k]) ^ (a[i + 3] + b[k]);
				ans ^= (a[i + 4] + b[k]) ^ (a[i + 5] + b[k]);
				ans ^= (a[i + 6] + b[k]) ^ (a[i + 7] + b[k]);
              	ans ^= (a[i + 8] + b[k]) ^ (a[i + 9] + b[k]);
				ans ^= (a[i + 10] + b[k]) ^ (a[i + 11] + b[k]);
				ans ^= (a[i + 12] + b[k]) ^ (a[i + 13] + b[k]);
				ans ^= (a[i + 14] + b[k]) ^ (a[i + 15] + b[k]);

			}
		}
	}

	for (int i = 0; i < N / unrl * unrl; i++) {
		for (int j = N / block * block; j < N; j++) {
			ans ^= a[i] + b[j];
		}
	}	
	for (int i = N / unrl * unrl; i < N; i++) {
		for (int j = 0; j < N; j++) {
			ans ^= a[i] + b[j];
		}
	}

	printf("%d\n", ans);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:107:13: error: reference to 'cin' is ambiguous
  107 |         N = cin.scan();
      |             ^~~
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: candidates are: 'std::istream std::cin'
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:102:17: note:                 'FastIn::Scanner cin'
  102 | FastIn::Scanner cin;
      |                 ^~~
a.cc:108:44: error: reference to 'cin' is ambiguous
  108 |         for (int i = 0; i < N; i++) a[i] = cin.scan();
      |                                            ^~~
/usr/include/c++/14/iostream:62:18: note: candidates are: 'std::istream std::cin'
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:102:17: note:                 'FastIn::Scanner cin'
  102 | FastIn::Scanner cin;
      |                 ^~~
a.cc:109:44: error: reference to 'cin' is ambiguous
  109 |         for (int i = 0; i < N; i++) b[i] = cin.scan();
      |                                            ^~~
/usr/include/c++/14/iostream:62:18: note: candidates are: 'std::istream std::cin'
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:102:17: note:                 'FastIn::Scanner cin'
  102 | FastIn::Scanner cin;
      |                 ^~~