結果
| 問題 | No.698 ペアでチームを作ろう |
| ユーザー |
|
| 提出日時 | 2018-07-21 15:39:09 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 555 bytes |
| 記録 | |
| コンパイル時間 | 535 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-06-01 00:19:45 |
| 合計ジャッジ時間 | 3,416 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()