結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー tora3kuma3tora3kuma3
提出日時 2015-04-18 10:51:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 695 ms / 5,000 ms
コード長 390 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 20,664 KB
最終ジャッジ日時 2023-09-17 16:13:44
合計ジャッジ時間 14,655 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,836 KB
testcase_01 AC 16 ms
7,760 KB
testcase_02 AC 20 ms
7,848 KB
testcase_03 AC 16 ms
7,764 KB
testcase_04 AC 16 ms
7,792 KB
testcase_05 AC 16 ms
7,760 KB
testcase_06 AC 15 ms
7,824 KB
testcase_07 AC 16 ms
7,848 KB
testcase_08 AC 491 ms
17,180 KB
testcase_09 AC 116 ms
9,884 KB
testcase_10 AC 375 ms
14,836 KB
testcase_11 AC 271 ms
13,096 KB
testcase_12 AC 570 ms
18,400 KB
testcase_13 AC 605 ms
19,532 KB
testcase_14 AC 360 ms
14,604 KB
testcase_15 AC 678 ms
20,420 KB
testcase_16 AC 551 ms
18,164 KB
testcase_17 AC 608 ms
18,984 KB
testcase_18 AC 16 ms
7,848 KB
testcase_19 AC 15 ms
7,756 KB
testcase_20 AC 46 ms
9,868 KB
testcase_21 AC 691 ms
20,664 KB
testcase_22 AC 685 ms
20,640 KB
testcase_23 AC 16 ms
7,820 KB
testcase_24 AC 16 ms
7,832 KB
testcase_25 AC 16 ms
7,944 KB
testcase_26 AC 16 ms
7,836 KB
testcase_27 AC 16 ms
7,836 KB
testcase_28 AC 418 ms
15,728 KB
testcase_29 AC 577 ms
18,900 KB
testcase_30 AC 506 ms
17,600 KB
testcase_31 AC 425 ms
16,280 KB
testcase_32 AC 538 ms
18,332 KB
testcase_33 AC 676 ms
20,392 KB
testcase_34 AC 660 ms
20,268 KB
testcase_35 AC 695 ms
20,636 KB
testcase_36 AC 680 ms
20,500 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