結果

問題 No.698 ペアでチームを作ろう
ユーザー GrayCoderGrayCoder
提出日時 2018-07-21 15:26:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 520 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 8,636 KB
最終ジャッジ日時 2023-08-27 00:37:04
合計ジャッジ時間 1,792 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,484 KB
testcase_01 AC 17 ms
8,492 KB
testcase_02 AC 20 ms
8,496 KB
testcase_03 AC 17 ms
8,488 KB
testcase_04 WA -
testcase_05 AC 43 ms
8,484 KB
testcase_06 WA -
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 #

from collections import deque
from itertools import combinations
from sys import stdin, stdout
input = lambda: stdin.readline().rstrip()
write = stdout.write

def main():
    N = int(input())
    A = tuple(map(int, input().split()))

    ans = 0
    for a in combinations(A, N // 2):
        b = deque(set(A) - set(a))
        for _ in [0] * (N - 1):
            power = 0
            for x, y in zip(a, b):
                power += x ^ y
            ans = max(ans, power)
            b.rotate(1)
    print(ans)

main()
0