結果

問題 No.699 ペアでチームを作ろう2
ユーザー nebukuro09
提出日時 2018-06-13 09:50:08
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
WA  
実行時間 -
コード長 439 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 736 ms
コンパイル使用メモリ 80,768 KB
実行使用メモリ 83,904 KB
最終ジャッジ日時 2026-03-20 15:18:46
合計ジャッジ時間 10,802 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 3 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from itertools import combinations, permutations 

N = input()
A = sorted(map(int, raw_input().split()))
ans = 0

for c in combinations(range(N), N/2):
    X = []
    Y = []
    for i in xrange(N):
        if i in c:
            X.append(A[i])
        else:
            Y.append(A[i])
    for p in permutations(X):
        tmp = 0
        for i in xrange(N/2):
            tmp ^= X[i] + Y[i]
        ans = max(ans, tmp)
        
print ans
0