結果
問題 | No.698 ペアでチームを作ろう |
ユーザー | 👑 H20 |
提出日時 | 2021-05-27 09:44:43 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 374 bytes |
コンパイル時間 | 278 ms |
コンパイル使用メモリ | 87,072 KB |
実行使用メモリ | 198,108 KB |
最終ジャッジ日時 | 2023-08-06 02:47:53 |
合計ジャッジ時間 | 3,585 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 70 ms
75,724 KB |
testcase_01 | AC | 69 ms
71,360 KB |
testcase_02 | AC | 84 ms
76,684 KB |
testcase_03 | AC | 71 ms
71,540 KB |
testcase_04 | AC | 170 ms
78,052 KB |
testcase_05 | TLE | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
ソースコード
import itertools N = int(input()) A = list(map(int,input().split())) C = list(itertools.combinations(range(N), N//2)) ans = 0 for c in C: r = list(range(N)) for i in c: r.remove(i) P = list(itertools.permutations(r)) for p in P: power=0 for i in range(N//2): power+=A[c[i]]^A[p[i]] ans = max(power,ans) print(ans)