結果

問題 No.699 ペアでチームを作ろう2
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2019-08-26 22:21:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 760 bytes
コンパイル時間 1,863 ms
コンパイル使用メモリ 166,272 KB
実行使用メモリ 10,144 KB
最終ジャッジ日時 2024-04-25 21:43:34
合計ジャッジ時間 3,976 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,144 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = (int)(n); i >= 0; i--)
#define FOR(i,n,m) for(int i = (int)(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = MOD - 1;
const ll LLINF = 4e18;

int main() {
    int n; cin >> n;
    vector<int> a(n);
    REP(i, n)  cin >> a[i];
    int ans = 0;
    do {
        int s = 0;
        REP(i, n / 2) {
            s ^= a[i] + a[i + n / 2];
        }
        ans = max(ans, s);
        reverse(a.begin() + n / 2, a.end());
    } while (next_permutation(ALL(a)));
    cout << ans << endl;
    getchar(); getchar();
}
0