結果
| 問題 | No.698 ペアでチームを作ろう |
| ユーザー |
|
| 提出日時 | 2018-07-21 15:39:09 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 555 bytes |
| 記録 | |
| コンパイル時間 | 83 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-12-26 04:51:43 |
| 合計ジャッジ時間 | 2,022 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 9 |
ソースコード
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
num = list(range(N))
for n in combinations(num, N // 2):
m = deque(set(num) - set(n))
for _ in [0] * (N - 1):
power = 0
for i, j in zip(n, m):
power += A[i] ^ A[j]
ans = max(ans, power)
m.rotate(1)
print(ans)
main()