結果

問題 No.130 XOR Minimax
ユーザー NoneNone
提出日時 2021-03-24 23:01:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 86,812 KB
実行使用メモリ 213,672 KB
最終ジャッジ日時 2023-08-17 22:39:23
合計ジャッジ時間 5,163 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 74 ms
71,376 KB
testcase_02 AC 70 ms
71,324 KB
testcase_03 AC 72 ms
71,416 KB
testcase_04 WA -
testcase_05 AC 225 ms
207,544 KB
testcase_06 AC 190 ms
159,124 KB
testcase_07 WA -
testcase_08 AC 238 ms
202,484 KB
testcase_09 AC 91 ms
77,324 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 83 ms
76,636 KB
testcase_13 WA -
testcase_14 AC 210 ms
189,916 KB
testcase_15 AC 80 ms
76,412 KB
testcase_16 AC 164 ms
146,372 KB
testcase_17 AC 166 ms
149,852 KB
testcase_18 AC 176 ms
157,448 KB
testcase_19 AC 190 ms
171,312 KB
testcase_20 AC 127 ms
114,044 KB
testcase_21 AC 207 ms
189,736 KB
testcase_22 WA -
testcase_23 AC 87 ms
77,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int, input().split()))
A0=A[:]
M=max(A)
L=M.bit_length()
for i in range(L)[::-1]:
    B=[]
    for a in A:
        B.append(a^(1<<i))
    temp=max(B)
    if temp<=M:
        M=temp
        A=B
if A==A0:
    M=10**18
    for i in range(L)[::-1]:
        B=[]
        for a in A0:
            B.append(a^(1<<i))
        temp=max(B)
        if temp<=M:
            M=temp

print(M)
0