Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <climits>
#include <cmath>
#include <functional>
#include <map>
// #include <bits/stdc++.h>
using namespace std;

#define size_t long long
typedef long long ll;
#define long long long long
typedef vector<long long> VI;
#define FOR(i, a, b) for(long long i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define debug(x) cerr << #x << " = " << (x) << " (line " << __LINE__ << ")" << endl;
#define debug1(i, x) cerr << "(" << (i) <<  ") " << #x << " = " << (x) << " (line " << __LINE__ << ")" << endl;
#define debug2(i, j, x) cerr << "(" << (i) << ", " << (j) <<  ") " << #x << " = " << (x) << " (line " << __LINE__ << ")" << endl;
template <typename T> class vec2d : public vector<vector<T>> {
public:
    vec2d(long long H, long long W): vector<vector<T>> (H, vector<T>(W)) {
    }
};
template <typename T> istream& operator >> (istream& is, vector<T>& vec){
  for(T& x: vec) is >> x;
  //for(long long i=0; i<vec.size(); i++) is >> x[i]; とかでもいいです。
  return is;
}
template <typename T> ostream& operator << (ostream& os, vector<T>& vec){
  REP(i, vec.size()) {
    os << vec[i] << ( i+1 == vec.size() ? "" : " " );
  }
  return os;
}
struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0);
        // cout<<fixed<<setprecision(20);
    };
}aaaaaaa;

signed main(signed argc, char **argv) {
  long long A, B;
  cin >> A >> B;
  long long N;
  for (N = 0; ; N++) {
    if (B < pow(2, N)) {
      break;
    }
  }
  long long M;
  for (M = 0; ; M++) {
    if (A < pow(2, M)) {
      break;
    }
  }
  vector<bool> v(N, 0);
  long long ans = 0;
  if (A % 4 == 2 || A % 4 == 3) {
    ans ^= 1;
  }
  if (B % 4 == 1 || B % 4 == 2) {
    ans ^= 1;
  }
  // long long ans = 0;
  long long a,b;
  for (size_t i = 0; i < N - 1; i++) {
    long long n = pow(2, i + 1);
    a = A % n;
    b = B % n;
    if (a >= n/2) {
      v[i] = v[i] ^ ((a - n/2)%2);
    }
    if (b >= n/2) {
      v[i] = v[i] ^ !((b - n/2)%2);
    }
  }
  // v[0] = (1 + B - A) % 2;
  if (M == N) {
    v[N - 1] = (1 + B - A) % 2;
  } else {
    v[N - 1] = (1 + B - (long long)pow(2, N - 1)) % 2;
  }
  for (size_t i = 1; i < N; i++) {
    if (v[i] % 2 == 1) {
      ans += pow(2, i);
    }
  }
  // debug(v);
  // debug(ans);
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:16:16: note: in expansion of macro 'long'
   16 | typedef vector<long long> VI;
      |                ^~~~
a.cc:15:14: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |              ^~~~
a.cc:16:21: note: in expansion of macro 'long'
   16 | typedef vector<long long> VI;
      |                     ^~~~
a.cc:15:19: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                   ^~~~
a.cc:16:21: note: in expansion of macro 'long'
   16 | typedef vector<long long> VI;
      |                     ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:16:21: note: in expansion of macro 'long'
   16 | typedef vector<long long> VI;
      |                     ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:26:11: note: in expansion of macro 'long'
   26 |     vec2d(long long H, long long W): vector<vector<T>> (H, vector<T>(W)) {
      |           ^~~~
a.cc:15:14: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |              ^~~~
a.cc:26:16: note: in expansion of macro 'long'
   26 |     vec2d(long long H, long long W): vector<vector<T>> (H, vector<T>(W)) {
      |                ^~~~
a.cc:15:19: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                   ^~~~
a.cc:26:16: note: in expansion of macro 'long'
   26 |     vec2d(long long H, long long W): vector<vector<T>> (H, vector<T>(W)) {
      |                ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:26:16: note: in expansion of macro 'long'
   26 |     vec2d(long long H, long long W): vector<vector<T>> (H, vector<T>(W)) {
      |                ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:26:24: note: in expansion of macro 'long'
   26 |     vec2d(long long H, long long W): vector<vector<T>> (H, vector<T>(W)) {
      |                        ^~~~
a.cc:15:14: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |              ^~~~
a.cc:26:29: note: in expansion of macro 'long'
   26 |     vec2d(long long H, long long W): vector<vector<T>> (H, vector<T>(W)) {
      |                             ^~~~
a.cc:15:19: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                   ^~~~
a.cc:26:29: note: in expansion of macro 'long'
   26 |     vec2d(long long H, long long W): vector<vector<T>> (H, vector<T>(W)) {
      |                             ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:26:29: note: in expansion of macro 'long'
   26 |     vec2d(long long H, long long W): vector<vector<T>> (H, vector<T>(W)) {
      |                             ^~~~
a.cc: In function 'std::ostream& operator<<(std::ostream&, std::vector<T>&)':
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:17:26: note: in expansion of macro 'long'
   17 | #define FOR(i, a, b) for(long long i = (a); i < (b); i++)
      |                          ^~~~
a.cc:18:19: note: in expansion of macro 'FOR'
   18 | #define REP(i, n) FOR(i, 0, n)
      |                   ^~~
a.cc:35:3: note: in expansion of macro 'REP'
   35 |   REP(i, vec.size()) {
      |   ^~~
a.cc:15:14: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |              ^~~~
a.cc:17:31: note: in expansion of macro 'long'
   17 | #define FOR(i, a, b) for(long long i = (a); i < (b); i++)
      |                               ^~~~
a.cc:18:19: note: in expansion of macro 'FOR'
   18 | #define REP(i, n) FOR(i, 0, n)
      |                   ^~~
a.cc:35:3: note: in expansion of macro 'REP'
   35 |   REP(i, vec.size()) {
      |   ^~~
a.cc:15:19: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                   ^~~~
a.cc:17:31: note: in expansion of macro 'long'
   17 | #define FOR(i, a, b) for(long long i = (a); i < (b); i++)
      |                               ^~~~
a.cc:18:19: note: in expansion of macro 'FOR'
   18 | #define REP(i, n) FOR(i, 0, n)
      |                   ^~~
a.cc:35:3: note: in expansion of macro 'REP'
   35 |   REP(i, vec.size()) {
      |   ^~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:17:31: note: in expansion of macro 'long'
   17 | #define FOR(i, a, b) for(long long i = (a); i < (b); i++)
      |                               ^~~~
a.cc:18:19: note: in expansion of macro 'FOR'
   18 | #define REP(i, n) FOR(i, 0, n)
      |                   ^~~
a.cc:35:3: note: in expansion of macro 'REP'
   35 |   REP(i, vec.size()) {
      |   ^~~
a.cc: In function 'int main(int, char**)':
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:48:3: note: in expansion of macro 'long'
   48 |   long long A, B;
      |   ^~~~
a.cc:15:14: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |              ^~~~
a.cc:48:8: note: in expansion of macro 'long'
   48 |   long long A, B;
      |        ^~~~
a.cc:15:19: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                   ^~~~
a.cc:48:8: note: in expansion of macro 'long'
   48 |   long long A, B;
      |        ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:48:8: note: in expansion of macro 'long'
   48 |   long long A, B;
      |        ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:50:3: note: in expansion of macro 'long'
   50 |   long long N;
      |   ^~~~
a.cc:15:14: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |              ^~~~
a.cc:50:8: note: in expansion of macro 'long'
   50 |   long long N;
      |        ^~~~
a.cc:15:19: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                   ^~~~
a.cc:50:8: note: in expansion of macro 'long'
   50 |   long long N;
      |        ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:50:8: note: in expansion of macro 'long'
   50 |   long long N;
      |        ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:56:3: note: in expansion of macro 'long'
   56 |   long long M;
      |   ^~~~
a.cc:15:14: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |              ^~~~
a.cc:56:8: note: in expansion of macro 'long'
   56 |   long long M;
      |        ^~~~
a.cc:15:19: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                   ^~~~
a.cc:56:8: note: in expansion of macro 'long'
   56 |   long long M;
      |        ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:56:8: note: in expansion of macro 'long'
   56 |   long long M;
      |        ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:63:3: note: in expansion of macro 'long'
   63 |   long long ans = 0;
      |   ^~~~
a.cc:15:14: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |              ^~~~
a.cc:63:8: note: in expansion of macro 'long'
   63 |   long long ans = 0;
      |        ^~~~
a.cc:15:19: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                   ^~~~
a.cc:63:8: note: in expansion of macro 'long'
   63 |   long long ans = 0;
      |        ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:63:8: note: in expansion of macro 'long'
   63 |   long long ans = 0;
      |        ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:71:3: note: in expansion of macro 'long'
   71 |   long long a,b;
      |   ^~~~
a.cc:15:14: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |              ^~~~
a.cc:71:8: note: in expansion of macro 'long'
   71 |   long long a,b;
      |        ^~~~
a.cc:15:19: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                   ^~~~
a.cc:71:8: note: in expansion of macro 'long'
   71 |   long long a,b;
      |        ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:71:8: note: in expansion of macro 'long'
   71 |   long long a,b;
      |        ^~~~
a.cc:15:24: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |                        ^~~~
a.cc:13:16: note: in expansion of macro 'long'
   13 | #define size_t long long
      |                ^~~~
a.cc:72:8: note: in expansion of macro 'size_t'
   72 |   for (size_t i = 0; i < N - 1; i++) {
      |        ^~~~~~
a.cc:15:14: error: 'long long long' is too long for GCC
   15 | #define long long long long
      |              ^~~~
a.cc:13:21: note: in expansion of macro 'long'
   13 | #define size_t long long
      |                     ^~~~
a.cc:72:8: note: in expansion of macro 'size_t'
   7