aboutsummaryrefslogtreecommitdiff
path: root/MaximizingXOR.cpp
blob: 71fc6d8ace752a9dbc1c33fcee1b5c1e23e9328b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<bits/stdc++.h>
#include <queue>

using namespace std;

int main() {
  int l, r;
  cin >> l >> r;
  priority_queue<int>pq;
  for(int i = l; i <= r;i++) {
    for(int j = i; j <= r;j++) {
      pq.push(i ^ j);
    }
  }
  cout << pq.top() << '\n';
  return 0;
}