結果

問題 No.699 ペアでチームを作ろう2
ユーザー AEnAEn
提出日時 2022-06-01 13:55:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 241 ms / 1,000 ms
コード長 325 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 81,844 KB
実行使用メモリ 77,188 KB
最終ジャッジ日時 2023-10-21 00:48:54
合計ジャッジ時間 3,690 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,536 KB
testcase_01 AC 37 ms
53,536 KB
testcase_02 AC 84 ms
70,696 KB
testcase_03 AC 37 ms
53,536 KB
testcase_04 AC 95 ms
76,132 KB
testcase_05 AC 236 ms
76,828 KB
testcase_06 AC 235 ms
77,120 KB
testcase_07 AC 236 ms
76,820 KB
testcase_08 AC 240 ms
77,176 KB
testcase_09 AC 238 ms
76,824 KB
testcase_10 AC 235 ms
77,188 KB
testcase_11 AC 238 ms
76,812 KB
testcase_12 AC 235 ms
76,816 KB
testcase_13 AC 241 ms
77,168 KB
testcase_14 AC 237 ms
77,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**9)

N = int(input())
A = list(map(int, input().split()))

def dfs(sets, p):
    ans = []
    if not sets:
        return p
    m = min(sets)
    sets ^= {m}
    for i in sets:
        ans.append(dfs(sets^{i}, p ^ (A[m]+A[i])))
    return max(ans)

sets = set(range(N))
print(dfs(sets, 0))
0