結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー gr1msl3ygr1msl3y
提出日時 2021-11-03 19:51:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 47 ms / 5,000 ms
コード長 358 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 82,460 KB
実行使用メモリ 61,568 KB
最終ジャッジ日時 2024-04-21 12:24:13
合計ジャッジ時間 1,994 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,224 KB
testcase_01 AC 34 ms
51,840 KB
testcase_02 AC 34 ms
52,608 KB
testcase_03 AC 32 ms
52,224 KB
testcase_04 AC 31 ms
51,840 KB
testcase_05 AC 30 ms
52,096 KB
testcase_06 AC 30 ms
51,712 KB
testcase_07 AC 39 ms
61,056 KB
testcase_08 AC 40 ms
61,568 KB
testcase_09 AC 41 ms
61,312 KB
testcase_10 AC 40 ms
61,056 KB
testcase_11 AC 39 ms
61,184 KB
testcase_12 AC 33 ms
51,840 KB
testcase_13 AC 47 ms
52,224 KB
testcase_14 AC 40 ms
61,056 KB
testcase_15 AC 39 ms
61,312 KB
testcase_16 AC 32 ms
52,196 KB
testcase_17 AC 37 ms
60,160 KB
testcase_18 AC 40 ms
61,056 KB
testcase_19 AC 36 ms
59,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
M = 61
bit = [0]*M
ct = 0
for a in A:
    for i in range(M-1, -1, -1):
        if (a >> i) & 1:
            a ^= bit[i]
    if a == 0:
        continue
    ct += 1
    l = a.bit_length()-1
    bit[l] = a
    for i in range(l+1, M):
        if (bit[i] >> l) & 1:
            bit[i] ^= a

print(pow(2, ct))
0