結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー ntuda
提出日時 2025-01-23 19:54:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 659 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 82,592 KB
実行使用メモリ 260,456 KB
最終ジャッジ日時 2025-01-23 19:55:11
合計ジャッジ時間 13,970 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
cnt = 0
for i in reversed(range(61)):
    B = []
    tp = 1 << i
    A = sorted(list(set(A)))
    if A and (A[-1] >= tp):
        cnt += 1
        a = A.pop()
    while A and (A[-1] >= tp):
        x = A.pop() ^ a
        B.append(x)
    A += B
print(pow(2,cnt))
0