結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー gr1msl3ygr1msl3y
提出日時 2021-11-03 19:50:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 358 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 93,216 KB
最終ジャッジ日時 2024-04-21 12:23:15
合計ジャッジ時間 5,476 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
51,840 KB
testcase_01 AC 31 ms
51,968 KB
testcase_02 AC 34 ms
58,240 KB
testcase_03 AC 34 ms
52,096 KB
testcase_04 AC 33 ms
57,344 KB
testcase_05 AC 33 ms
57,984 KB
testcase_06 AC 30 ms
52,224 KB
testcase_07 AC 36 ms
58,112 KB
testcase_08 AC 107 ms
87,808 KB
testcase_09 AC 52 ms
66,552 KB
testcase_10 AC 88 ms
80,512 KB
testcase_11 AC 78 ms
75,392 KB
testcase_12 AC 119 ms
90,752 KB
testcase_13 AC 124 ms
91,008 KB
testcase_14 AC 89 ms
79,872 KB
testcase_15 AC 131 ms
93,112 KB
testcase_16 AC 114 ms
89,088 KB
testcase_17 AC 121 ms
91,008 KB
testcase_18 AC 35 ms
58,112 KB
testcase_19 AC 31 ms
51,456 KB
testcase_20 AC 76 ms
83,200 KB
testcase_21 AC 133 ms
93,184 KB
testcase_22 AC 140 ms
93,216 KB
testcase_23 AC 41 ms
58,496 KB
testcase_24 AC 34 ms
58,112 KB
testcase_25 AC 34 ms
58,500 KB
testcase_26 AC 31 ms
51,840 KB
testcase_27 AC 35 ms
58,240 KB
testcase_28 AC 92 ms
83,200 KB
testcase_29 AC 118 ms
91,008 KB
testcase_30 AC 113 ms
89,128 KB
testcase_31 AC 99 ms
85,120 KB
testcase_32 AC 117 ms
89,216 KB
testcase_33 AC 135 ms
93,072 KB
testcase_34 AC 132 ms
92,928 KB
testcase_35 AC 134 ms
93,056 KB
testcase_36 AC 132 ms
92,800 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