結果
| 問題 |
No.699 ペアでチームを作ろう2
|
| ユーザー |
|
| 提出日時 | 2018-06-13 09:59:14 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 523 bytes |
| コンパイル時間 | 1,610 ms |
| コンパイル使用メモリ | 76,928 KB |
| 実行使用メモリ | 78,720 KB |
| 最終ジャッジ日時 | 2024-06-30 14:05:23 |
| 合計ジャッジ時間 | 18,965 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 TLE * 10 |
ソースコード
from itertools import combinations, permutations
N = input()
A = sorted(map(int, raw_input().split()))
ans = 0
X = [0 for _ in xrange(N/2)]
Y = [0 for _ in xrange(N/2)]
for c in combinations(range(N), N/2):
x, y = 0, 0
for i in xrange(N):
if i in c:
X[x] = A[i]
x += 1
else:
Y[y] = A[i]
y += 1
for p in permutations(X):
tmp = 0
for i in xrange(N/2):
tmp ^= p[i] + Y[i]
ans = max(ans, tmp)
print ans