結果

問題 No.130 XOR Minimax
コンテスト
ユーザー LyricalMaestro
提出日時 2025-10-28 01:34:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 485 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 82,568 KB
実行使用メモリ 86,944 KB
最終ジャッジ日時 2025-10-28 01:34:59
合計ジャッジ時間 3,501 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 2 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# https://yukicoder.me/problems/no/1219

from collections import deque

def main():
    N = int(input())
    A = list(map(int, input().split()))

    answer = 0
    for k in range(40):
        x = 2 ** k
        count = [0, 0]
        for a in A:
            if (1 << k) & a > 0:
                count[1] += 1
            else:
                count[0] += 1

        if count[0] > 0 and count[1] > 0:
            answer += x
    print(answer)





if __name__ == "__main__":
    main()
0