結果

問題 No.698 ペアでチームを作ろう
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2021-12-19 00:15:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 349 bytes
コンパイル時間 827 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 8,712 KB
最終ジャッジ日時 2023-10-13 18:29:59
合計ジャッジ時間 9,169 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,840 KB
testcase_01 AC 16 ms
7,868 KB
testcase_02 WA -
testcase_03 AC 16 ms
7,816 KB
testcase_04 WA -
testcase_05 AC 677 ms
8,104 KB
testcase_06 AC 691 ms
8,020 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
dp = [0]*(1<<N)

for i in range(1<<N):

    
    for s in range(N-1):
        for t in range(s+1,N):
            tmp = (1<<s) + (1<<t)
    
            if i&tmp != 0:
                continue
            else:
                dp[i|tmp] = max(dp[i|tmp],dp[i] + A[s]^A[t])
            
print(dp[-1])
0