結果
| 問題 | No.699 ペアでチームを作ろう2 |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 21:05:20 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 58 ms / 1,000 ms |
| + 106µs | |
| コード長 | 540 bytes |
| 記録 | |
| コンパイル時間 | 89 ms |
| コンパイル使用メモリ | 64,852 KB |
| 実行使用メモリ | 58,780 KB |
| 最終ジャッジ日時 | 2026-10-17 14:18:54 |
| 合計ジャッジ時間 | 2,260 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
def dfs(mask, current_xor):
if mask == (1 << N) - 1:
return current_xor
# Find the first unused player
i = 0
while i < N and (mask & (1 << i)):
i += 1
max_val = 0
for j in range(i + 1, N):
if not (mask & (1 << j)):
new_mask = mask | (1 << i) | (1 << j)
s = A[i] + A[j]
res = dfs(new_mask, current_xor ^ s)
if res > max_val:
max_val = res
return max_val
print(dfs(0, 0))
lam6er