結果
| 問題 | No.698 ペアでチームを作ろう |
| ユーザー |
|
| 提出日時 | 2021-08-29 07:18:16 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 301 bytes |
| 記録 | |
| コンパイル時間 | 463 ms |
| コンパイル使用メモリ | 20,952 KB |
| 実行使用メモリ | 15,612 KB |
| 最終ジャッジ日時 | 2026-05-16 06:50:27 |
| 合計ジャッジ時間 | 7,246 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 3 WA * 9 |
ソースコード
n=int(input())
A=list(map(int,input().split()))
dp=[0]*(1<<n)
for s in range(1<<n):
for a in range(n):
for b in range(a+1,n):
if not(s>>a)&1:
if not(s>>b)&1:
dp[s|(1<<a)|(1<<b)]=max(dp[s|(1<<a)|(1<<b)],dp[s]+A[a]^A[b])
print(dp[(1<<n)-1])