結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー fmhrfmhr
提出日時 2015-04-17 14:28:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,127 ms / 5,000 ms
コード長 288 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 21,296 KB
最終ジャッジ日時 2023-09-17 16:36:38
合計ジャッジ時間 36,664 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,916 KB
testcase_01 AC 16 ms
7,740 KB
testcase_02 AC 16 ms
7,772 KB
testcase_03 AC 15 ms
7,928 KB
testcase_04 AC 16 ms
7,772 KB
testcase_05 AC 16 ms
7,824 KB
testcase_06 AC 16 ms
7,856 KB
testcase_07 AC 17 ms
7,856 KB
testcase_08 AC 1,530 ms
17,140 KB
testcase_09 AC 328 ms
9,868 KB
testcase_10 AC 1,164 ms
14,916 KB
testcase_11 AC 818 ms
13,356 KB
testcase_12 AC 1,760 ms
18,396 KB
testcase_13 AC 1,886 ms
19,356 KB
testcase_14 AC 1,089 ms
14,384 KB
testcase_15 AC 2,054 ms
21,236 KB
testcase_16 AC 1,724 ms
19,116 KB
testcase_17 AC 1,842 ms
19,068 KB
testcase_18 AC 17 ms
7,968 KB
testcase_19 AC 16 ms
7,788 KB
testcase_20 AC 69 ms
10,024 KB
testcase_21 AC 2,118 ms
20,708 KB
testcase_22 AC 2,126 ms
20,816 KB
testcase_23 AC 16 ms
7,780 KB
testcase_24 AC 16 ms
7,872 KB
testcase_25 AC 16 ms
7,804 KB
testcase_26 AC 16 ms
7,804 KB
testcase_27 AC 16 ms
7,852 KB
testcase_28 AC 1,281 ms
16,396 KB
testcase_29 AC 1,780 ms
18,880 KB
testcase_30 AC 1,531 ms
18,428 KB
testcase_31 AC 1,330 ms
16,456 KB
testcase_32 AC 1,633 ms
19,160 KB
testcase_33 AC 2,086 ms
21,296 KB
testcase_34 AC 2,028 ms
20,140 KB
testcase_35 AC 2,089 ms
20,644 KB
testcase_36 AC 2,127 ms
20,552 KB
権限があれば一括ダウンロードができます

ソースコード

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