結果

問題 No.1082 XORのXOR
ユーザー iqueue02iqueue02
提出日時 2020-06-19 21:59:04
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 580 bytes
コンパイル時間 6,204 ms
コンパイル使用メモリ 196,244 KB
最終ジャッジ日時 2025-01-11 06:14:01
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, int> PL;
constexpr int mod =  1e9 + 7;
constexpr int INF = 2e9;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  sort(a.begin(), a.end());
  int x = 0, y = INF;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      x = max(x, (a[i] ^ a[j]));
      y = min(y, (a[i] ^ a[j]));
    }
  }
  cout << x << endl;
  return 0;
} 
0