Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (ll)(n); i

int main() {
  ll a, b; cin >> a >> b;
  if (a%2) {
    bitset <50> s(a);
    rep(i, (b-a)%4) {
      bitset <50> tmp_1 = s;
      bitset <50> tmp_2(b-i);
      ll tmp = 0;
      rep(j, 50) {
        if (tmp_1&(1<<j)) {
          if (!(tmp_2&(1<<j))) {
            tmp += (ll)pow(2, j);
          }
        } else {
          if (tmp_2&(1<<j)) {
            tmp += (ll)pow(2, j);
          }
        }
      }
      bitset <50> s(tmp);
    }
    ll res = 0;
    rep(i, 50) {
      if (s&(1<<i)) res += (ll)pow(2, i);
    }
    cout << res << endl;
  } else {
    bitset <50> s(0);
    rep(i, (b-a+1)%4) {
      bitset <50> tmp_1 = s;
      bitset <50> tmp_2(b-i);
      ll tmp = 0;
      rep(j, 50) {
        if (tmp_1&(1<<j)) {
          if (!(tmp_2&(1<<j))) {
            tmp += (ll)pow(2, j);
          }
        } else {
          if (tmp_2&(1<<j)) {
            tmp += (ll)pow(2, j);
          }
        }
      }
      bitset <50> s(tmp);
    }
    ll res = 0;
    rep(i, 50) {
      if (s&(1<<i)) res += (ll)pow(2, i);
    }
    cout << res << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: expected ')' before '{' token
   12 |     rep(i, (b-a)%4) {
      |                     ^
a.cc:6:23: note: to match this '('
    6 | #define rep(i, n) for (int i = 0; i < (ll)(n); i
      |                       ^
a.cc:12:5: note: in expansion of macro 'rep'
   12 |     rep(i, (b-a)%4) {
      |     ^~~
a.cc:16:18: error: expected ')' before '{' token
   16 |       rep(j, 50) {
      |                  ^
a.cc:6:23: note: to match this '('
    6 | #define rep(i, n) for (int i = 0; i < (ll)(n); i
      |                       ^
a.cc:16:7: note: in expansion of macro 'rep'
   16 |       rep(j, 50) {
      |       ^~~
a.cc:17:18: error: no match for 'operator&' (operand types are 'std::bitset<50>' and 'int')
   17 |         if (tmp_1&(1<<j)) {
      |             ~~~~~^~~~~~~
      |             |       |
      |             |       int
      |             std::bitset<50>
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bitset:1557:5: note: candidate: 'template<long unsigned int _Nb> std::bitset<_Nb> std::operator&(const bitset<_Nb>&, const bitset<_Nb>&)'
 1557 |     operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
      |     ^~~~~~~~
/usr/include/c++/14/bitset:1557:5: note:   template argument deduction/substitution failed:
a.cc:17:24: note:   mismatched types 'const std::bitset<_Nb>' and 'int'
   17 |         if (tmp_1&(1<<j)) {
      |                        ^
In file included from /usr/include/c++/14/valarray:605,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/bits/valarray_after.h:411:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__bitwise_and, typename _Dom1::value_type>::result_type> std::operator&(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
  411 |     _DEFINE_EXPR_BINARY_OPERATOR(&, struct std::__bitwise_and)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:411:5: note:   template argument deduction/substitution failed:
a.cc:17:24: note:   'std::bitset<50>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   17 |         if (tmp_1&(1<<j)) {
      |                        ^
/usr/include/c++/14/bits/valarray_after.h:411:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_and, typename _Dom1::value_type>::result_type> std::operator&(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
  411 |     _DEFINE_EXPR_BINARY_OPERATOR(&, struct std::__bitwise_and)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:411:5: note:   template argument deduction/substitution failed:
a.cc:17:24: note:   'std::bitset<50>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   17 |         if (tmp_1&(1<<j)) {
      |                        ^
/usr/include/c++/14/bits/valarray_after.h:411:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_and, typename _Dom1::value_type>::result_type> std::operator&(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  411 |     _DEFINE_EXPR_BINARY_OPERATOR(&, struct std::__bitwise_and)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:411:5: note:   template argument deduction/substitution failed:
a.cc:17:24: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
   17 |         if (tmp_1&(1<<j)) {
      |                        ^
/usr/include/c++/14/bits/valarray_after.h:411:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_and, typename _Dom1::value_type>::result_type> std::operator&(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
  411 |     _DEFINE_EXPR_BINARY_OPERATOR(&, struct std::__bitwise_and)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:411:5: note:   template argument deduction/substitution failed:
a.cc:17:24: note:   'std::bitset<50>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   17 |         if (tmp_1&(1<<j)) {
      |                        ^
/usr/include/c++/14/bits/valarray_after.h:411:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_and, typename _Dom1::value_type>::result_type> std::operator&(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  411 |     _DEFINE_EXPR_BINARY_OPERATOR(&, struct std::__bitwise_and)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:411:5: note:   template argument deduction/substitution failed:
a.cc:17:24: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
   17 |         if (tmp_1&(1<<j)) {
      |                        ^
/usr/include/c++/14/valarray:1202:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_and, _Tp>::result_type> std::operator&(const valarray<_Tp>&, const valarray<_Tp>&)'
 1202 | _DEFINE_BINARY_OPERATOR(&, __bitwise_and)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1202:1: note:   template argument deduction/substitution failed:
a.cc:17:24: note:   'std::bitset<50>' is not derived from 'const std::valarray<_Tp>'
   17 |         if (tmp_1&(1<<j)) {
      |                        ^
/usr/include/c++/14/valarray:1202:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__bitwise_and, _Tp>::result_type> std::operator&(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
 1202 | _DEFINE_BINARY_OPERATOR(&, __bitwise_and)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1202:1: note:   template argument deduction/substitution failed:
a.cc:17:24: note:   'std::bitset<50>' is not derived from 'const std::valarray<_Tp>'
   17 |         if (tmp_1&(1<<j)) {
      |                        ^
/usr/include/c++/14/valarray:1202:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_and, _Tp>::result_type> std::operator&(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
 1202 | _DEFINE_BINARY_OPERATOR(&, __bitwise_and)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1202:1: note:   template argument deduction/substitution failed:
a.cc:17:24: note:   mismatched types 'const std::valarray<_Tp>' and 'int'
   17 |         if (tmp_1&(1<<j)) {
      |                        ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:141:3: note: candidate: 'constexpr std::byte std::operator&(byte, byte)'
  141 |   operator&(byte __l, byte __r) noexcept
      |   ^~~~~~~~
/usr/include/c++/14/cstddef:141:18: note:   no known conversion for argument 1 from 'std::bitset<50>' to 'std::byte'
  141 |   operator&(byte __l, byte __r) noexcept
      |             ~~~~~^~~
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/ios_base.h:84:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator&(_Ios_Fmtflags, _Ios_Fmtflags)'
   84 |   operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:84:27: note:   no known conversion for argument 1 from 'std::bitset<50>' to 'std::_Ios_Fmtflags'
   84 |   operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:134:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator&(_Ios_Openmode, _Ios_Openmode)'
  134 |   operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:134:27: note:   no known conversion for argument 1 from 'std::bitset<50>' to 'std::_Ios_Openmode'
  134 |   operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:181:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator&(_Ios_Iostate, _Ios_Iostate)'
  181 |   operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:181:26: note:   no known conversion for argument 1 from 'std::bitset<50>' to 'std::_Ios_Iostate'
  181 |   operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/14/memory:81,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/atomic_base.h:109:3: note: candidate: 'constexpr std::memory_order std::operator&(memory_order, __memory_order_modifier)'
  109 |   operator&(memory_order __m, __memory_order_modifier __mod) noexcept
      |   ^~~~~~~~
/usr/include/c++/14/bits/atomic_base.h:109:26: note:   no known conversion for argument 1 from 'std::bitset<50>' to 'std::memory_order'
  109 |   operator&(memory_order __m, __