結果

問題 No.699 ペアでチームを作ろう2
ユーザー GrayCoderGrayCoder
提出日時 2019-11-06 23:40:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 141 ms / 1,000 ms
コード長 441 bytes
コンパイル時間 666 ms
コンパイル使用メモリ 10,944 KB
実行使用メモリ 13,672 KB
最終ジャッジ日時 2023-10-13 02:47:38
合計ジャッジ時間 2,937 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,960 KB
testcase_01 AC 15 ms
7,788 KB
testcase_02 AC 16 ms
7,900 KB
testcase_03 AC 16 ms
7,792 KB
testcase_04 AC 25 ms
8,520 KB
testcase_05 AC 115 ms
9,272 KB
testcase_06 AC 116 ms
9,272 KB
testcase_07 AC 133 ms
13,672 KB
testcase_08 AC 140 ms
13,604 KB
testcase_09 AC 140 ms
13,516 KB
testcase_10 AC 140 ms
13,444 KB
testcase_11 AC 140 ms
13,616 KB
testcase_12 AC 141 ms
13,564 KB
testcase_13 AC 139 ms
13,520 KB
testcase_14 AC 140 ms
13,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin


def main():
    def func(a, p):
        n = len(a)
        if n == 2:
            pwr.append(p ^ (a[0] + a[1]))
            return
        for i in range(1, n):
            a_ = a[1:i] + a[i+1:]
            p_ = p ^ (a[0] + a[i])
            func(a_, p_)

    input = lambda: stdin.readline()[:-1]
    N = int(input())
    A = list(map(int, input().split()))

    pwr = []
    func(A, 0)
    print(max(pwr))


main()
0