結果

問題 No.698 ペアでチームを作ろう
ユーザー DrDrpilotDrDrpilot
提出日時 2022-08-18 17:39:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 1,000 ms
コード長 255 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 76,672 KB
最終ジャッジ日時 2024-04-16 01:41:19
合計ジャッジ時間 2,085 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,584 KB
testcase_01 AC 45 ms
51,968 KB
testcase_02 AC 51 ms
60,800 KB
testcase_03 AC 40 ms
51,584 KB
testcase_04 AC 72 ms
71,808 KB
testcase_05 AC 107 ms
76,288 KB
testcase_06 AC 106 ms
76,288 KB
testcase_07 AC 106 ms
76,160 KB
testcase_08 AC 107 ms
76,288 KB
testcase_09 AC 105 ms
76,288 KB
testcase_10 AC 104 ms
76,416 KB
testcase_11 AC 107 ms
76,288 KB
testcase_12 AC 107 ms
76,544 KB
testcase_13 AC 105 ms
76,288 KB
testcase_14 AC 107 ms
76,672 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