結果

問題 No.130 XOR Minimax
ユーザー None
提出日時 2021-03-24 23:15:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 287,792 KB
最終ジャッジ日時 2024-11-26 23:32:08
合計ジャッジ時間 12,917 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int, input().split()))
A0=A[:]
M=max(A)
L=M.bit_length()

dp=[[] for _ in range(L+1)]

dp[0]=A

for i in range(L)[::-1]:
    for cnt in range(i+1):
        B=[]
        for a in dp[cnt]:
            B.append(a^(1<<i))
        temp=max(B)
        if not dp[cnt+1] or temp<=max(dp[cnt+1]):
            dp[cnt+1]=B

res=10**18
for B in dp[1:]:
    res=min(max(B),res)
print(res)
0