結果
問題 | No.1082 XORのXOR |
ユーザー |
|
提出日時 | 2020-06-19 21:27:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 679 bytes |
コンパイル時間 | 1,410 ms |
コンパイル使用メモリ | 169,508 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-03 13:47:23 |
合計ジャッジ時間 | 2,297 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for (int i = 0; i < (n); i ++)using namespace std;using ll = long long;using PL = pair<ll,ll>;using P = pair<int,int>;constexpr int INF = 1000000000;constexpr long long HINF = 1000000000000000;constexpr long long MOD = 1000000007;constexpr double EPS = 1e-4;constexpr double PI = 3.14159265358979;const int MAXN = 200005;int main() {int N; cin >> N;vector<ll> A(N);rep(i,N) cin >> A[i];ll ret = 0;rep(i,N) {ret ^= A[i];ret ^= A[i];}ll ans = 0;rep(i,N)for(int j = i + 1;j < N;j++) {ans = max(ans,ret^A[i]^A[j]);}cout << ans << endl;return 0;}