結果
| 問題 | No.699 ペアでチームを作ろう2 |
| ユーザー |
|
| 提出日時 | 2026-07-16 08:03:02 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 154 ms / 1,000 ms |
| + 146µs | |
| コード長 | 509 bytes |
| 記録 | |
| コンパイル時間 | 266 ms |
| コンパイル使用メモリ | 95,860 KB |
| 実行使用メモリ | 85,456 KB |
| 最終ジャッジ日時 | 2026-07-16 08:03:06 |
| 合計ジャッジ時間 | 3,319 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
N = int(input())
A = list(map(int,input().split()))
B = [0]*N
C = []
ans = 0
def dfs(n):
global ans
if n==N:
cnt = 0
for k in range(len(C)):
cnt = cnt^C[k]
ans = max(ans,cnt)
return
ind0 = B.index(0)
for ind1 in range(ind0+1,N):
if B[ind1]==0:
C.append(A[ind0]+A[ind1])
B[ind0] = 1
B[ind1] = 1
dfs(n+2)
B[ind0] = 0
B[ind1] = 0
C.pop()
dfs(0)
print(ans)