結果
| 問題 | No.698 ペアでチームを作ろう |
| ユーザー |
ntuda
|
| 提出日時 | 2024-10-20 16:32:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 410 bytes |
| コンパイル時間 | 512 ms |
| コンパイル使用メモリ | 82,460 KB |
| 実行使用メモリ | 67,072 KB |
| 最終ジャッジ日時 | 2024-10-20 16:32:07 |
| 合計ジャッジ時間 | 2,575 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 12 |
ソースコード
from sortedcontainers import SortedList
def dfs():
global ans, sum0
if not S:
ans = max(ans, sum0)
return
a = S.pop(0)
for b in range(len(S)):
c = S.pop(b)
sum0 += A[a] ^ A[c]
dfs()
S.add(c)
sum0 -= A[a] ^ A[c]
S.add(a)
N = int(input())
A = list(map(int, input().split()))
S = SortedList(range(N))
ans = 0
sum0 = 0
dfs()
print(ans)
ntuda