結果

問題 No.698 ペアでチームを作ろう
ユーザー DrDrpilotDrDrpilot
提出日時 2022-08-18 17:39:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 196 ms / 1,000 ms
コード長 255 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-16 01:41:28
合計ジャッジ時間 2,821 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,752 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 33 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 42 ms
10,880 KB
testcase_05 AC 174 ms
10,752 KB
testcase_06 AC 173 ms
10,752 KB
testcase_07 AC 192 ms
10,752 KB
testcase_08 AC 190 ms
10,752 KB
testcase_09 AC 189 ms
10,752 KB
testcase_10 AC 190 ms
10,880 KB
testcase_11 AC 188 ms
10,880 KB
testcase_12 AC 191 ms
10,752 KB
testcase_13 AC 196 ms
10,752 KB
testcase_14 AC 189 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
ans=0
def f(now,a):
    global ans
    if len(a)==2:
        now+=(a[0]^a[1])
        ans=max(ans,now)
        return
    for i in range(1,len(a)):
        f(now+(a[0]^a[i]),a[1:i]+a[i+1:])
f(0,a)
print(ans)
0