結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー tora3kuma3tora3kuma3
提出日時 2015-04-18 10:57:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 176 ms / 5,000 ms
コード長 390 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 94,428 KB
最終ジャッジ日時 2023-09-17 16:45:08
合計ジャッジ時間 6,597 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,224 KB
testcase_01 AC 77 ms
71,212 KB
testcase_02 AC 75 ms
71,556 KB
testcase_03 AC 76 ms
71,356 KB
testcase_04 AC 76 ms
71,212 KB
testcase_05 AC 76 ms
71,496 KB
testcase_06 AC 76 ms
71,484 KB
testcase_07 AC 76 ms
71,280 KB
testcase_08 AC 148 ms
88,184 KB
testcase_09 AC 92 ms
77,152 KB
testcase_10 AC 128 ms
84,820 KB
testcase_11 AC 116 ms
81,816 KB
testcase_12 AC 152 ms
91,468 KB
testcase_13 AC 162 ms
92,008 KB
testcase_14 AC 128 ms
84,620 KB
testcase_15 AC 170 ms
93,828 KB
testcase_16 AC 152 ms
89,968 KB
testcase_17 AC 158 ms
91,896 KB
testcase_18 AC 78 ms
75,496 KB
testcase_19 AC 75 ms
71,356 KB
testcase_20 AC 94 ms
89,120 KB
testcase_21 AC 175 ms
94,148 KB
testcase_22 AC 169 ms
94,428 KB
testcase_23 AC 76 ms
71,308 KB
testcase_24 AC 76 ms
71,448 KB
testcase_25 AC 75 ms
71,300 KB
testcase_26 AC 76 ms
71,392 KB
testcase_27 AC 77 ms
71,284 KB
testcase_28 AC 133 ms
86,412 KB
testcase_29 AC 159 ms
91,740 KB
testcase_30 AC 149 ms
89,404 KB
testcase_31 AC 138 ms
87,728 KB
testcase_32 AC 149 ms
89,852 KB
testcase_33 AC 175 ms
93,580 KB
testcase_34 AC 176 ms
94,024 KB
testcase_35 AC 172 ms
94,344 KB
testcase_36 AC 171 ms
94,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#fmhrさんを参考に・・・
def hihgest_one_bit(i):
    return 1 << i.bit_length() - 1

def solve(a):
    ret = 0
    for i, ai in enumerate(a):
        if ai:
            ret += 1
            x = hihgest_one_bit(ai)
            for y in range(i + 1, len(a)):
                if a[y] & x:a[y] ^= ai
    return ret

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

print(1 << solve(a))
0