結果

問題 No.1082 XORのXOR
ユーザー ほえい
提出日時 2023-10-02 03:37:15
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 1,471 bytes
コンパイル時間 1,904 ms
コンパイル使用メモリ 194,964 KB
最終ジャッジ日時 2025-02-17 04:00:26
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define int long long
using namespace std;
using ld = long double;
using ull = unsigned long long;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define repp(i, m, n) for (int i = m; i < n; i++)
#define elif else if
#define yes cout << "Yes" << endl;
#define no  cout << "No"  << endl;
#define fi first
#define se second
#define r0 return 0;
#define Graph map<int,vector<int>>
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define eb emplace_back
#define pb pop_back
#define endl '\n'
const ld pi = 3.14159265358979;
const int di[] = {-1,-1,-1,0,0,1,1,1};
const int dj[] = {-1,0,1,-1,1,-1,0,1};
const int dx[] = {1,0,-1,0};
const int dy[] = {0,1,0,-1};
template <class T1, class T2> bool chmax(T1& a, T2 b) { if (a < b) { a = b; return true; } return false; }
template <class T1, class T2> bool chmin(T1& a, T2 b) { if (a > b) { a = b; return true; } return false; }
// priority_queue<int, vector<int>, greater<int>> pq;

/*
打つべし打つべし
   ∧_∧
   ( ・ω・)=つ≡つ
   (っ ≡つ=つ
   ./   ) ババババ
   ( / ̄∪
*/

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n; cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  int ans = 0;
  rep(i,n) repp(j,i+1,n) {
    chmax(ans, (a[i]^a[j]));
  }
  cout << ans << endl;
}
0