結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー fmhr
提出日時 2015-04-17 14:28:27
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 2,535 ms / 5,000 ms
コード長 288 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 22,548 KB
最終ジャッジ日時 2024-07-04 11:28:47
合計ジャッジ時間 43,209 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))

ret = 0
for i in range(n):
    if a[i]:
        ret += 1
        x = 0
        while (2**(x+1)) <= a[i]:
            x += 1
        for y in range(i+1, n, 1):
            if a[y] & (2 ** x):
                a[y] ^= a[i]

print(2**ret)
0